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 using fork() or clone() for each of the processes created at the OS Level?
Real Time Java threads and OS Level threads on Linux
1k Views Asked by rreyes1979 At
3
There are 3 best solutions below
0

Java thread on linux depends on the version, but most modern implementations use pthread, the thread for linux, not really a process. the linux thread is also know as lightweight processes, which is not generated by an fork call, but rather the pthread call. Threads run under the same process, and can share certain resources.
Yes they are of 1 to 1 relationship, (ps -Lf), but it is really hard to find out which is which, as the os thread id is an magic number only the jvm knows.
The article below should help.
From what I have seen on a RedHat 3.x - 5.x with Sun/Oracle JVM, It's a one OS process per Java thread. Don't know about fork vs. clone though.