1 Reply Latest reply: Jan 31, 2009 6:58 PM by 843829 RSS

    Thread Model and Context Switch


      I can find the documentation about JVM Thread Model only for Solaris platforms. [See here|http://java.sun.com/docs/hotspot/threads/threads.html]
      What about the Java Thread Model in Linux and in Windows?
      Why there isn't any documentation about this very important topic? It is very important to know if you are thinking about performance

      In many forums I have read, I have found that a lot of people think the JVM use a one-to-one Thread Model. That means that every Java Thread is mapped on 1 Native Thread in the OS.
      If this is true the OS has all the control to this threads: so the OS is the responsable of preemptive and context switch. This means the the Context Switch effect is due only to the OS scheduling.
      But in a test I have made I have found that there aren't so much Context Switch Effect. Also with 1000 threads running in the same time, I have that the performance is not so much different if I run 100 threads.
      So now the question: are there some optimization that the JVM does in order to reduce the Context Switch effect? Has the JVM a private thread scheduling?

      Thanks for the answers

      Edited by: Overflow on Jan 30, 2009 1:51 AM

      Edited by: Overflow on Jan 30, 2009 1:56 AM