Real-time Java threads and Linux OS-level threads

When using real-time java threads (either RealtimeThread or NoHeapRealtimeThread ), is there a 1-to-1 relationship between OS-level threads and Java threads? Also, is Java fork () or clone () used for each of the processes created at the OS level?

+4
source share
3 answers

The linux Java thread is version dependent, but most modern implementations use pthread, the thread for linux, not the process. The linux thread is also known as lightweight processes that are not generated by a fork call, but rather by a pthread call. Themes work under the same process and can share certain resources.

Yes, they are related from 1 to 1 (ps -Lf), but it’s very difficult to figure out what exactly, since the id of the os stream is a magic number that only jvm knows.

Below is the article below.

http://linuxprograms.wordpress.com/2007/12/19/linux-kernel-support-for-threads-light-weight-processe/

+2
source

Is it Java using fork () or clone () for each of the processes created at OS Level?

If you mean processes created by Runtime.exec (), it should use fork (). If you are still referring to threads, it cannot use fork () since threads are not processes.

0
source

From what I saw on RedHat 3.x - 5.x with the Sun / Oracle JVM, this is one OS process per Java thread. However, I do not know about fork vs. clone.

-1
source

All Articles