Kenneth P. Turvey wrote:
On Tue, 13 Nov 2007 00:46:03 -0500, Lew wrote:
Java VMs from Sun since 1.4.2 have not used green threads, at least not on
Linux with the Native POSIX Thread Library (NPTL).
<http://java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/index.html>
Just based on some experimentation I was doing, this doesn't seem to be
true. I'm running Linux with the Sun JVM, and it didn't map each Java
thread to a native thread until the Java thread was spending enough time
executing. I was actually trying to get this mapping (1 to 1) and found
it impossible to guarantee under Linux with the Sun JVM.
Under Solaris there is the -XX:UseBoundThreads (or something similar) to
get that behavior, but under Linux no such option exists.
I will freely admit that my experiment could have been flawed, but it
wasn't behaving as if it was using more than a single native thread. I
suspect that the article above is out of date.
Sun's literature and yours are based on experience.
The people that said, "It depends on the JVM" probably gave the best advice.