[Logo]
Forums Register Login
Green threads and multiple processors
I think I remember reading somewhere that green threads can not take advantage of multiple processors. This is on a Sun box. Is this true?
Native threads generally map to either a native OS/System thread or LightWeight Process. This means that when you create a new thread in Java, you get a new OS thread. In the case of Green threads, java creates and manages it's own virtual threads which don't have a corresponding OS thread. In this case Java and the application(s) it's running all effectively run in a single OS thread. So you're right, they won't take advantage of parallelism.
care to explain. what is a Green thread?


Green threads appear to be an artifact of the original Green Project, which was trying to design a hand-held computer based on the Sparc chip. So the original Java (the called "Oak") VM was written to run directly on the Sparc, without Solaris/SunOS. Because of that, they had to roll their own
thread support. The project to transform Oak into Java had very limited resources initially, they only did the bare minimum to port the language to desktop computers (as anyone who ever used the 1.0 AWT can attest). So they kept Green threads in the Solaris version because it worked, kind of.
The Green threads implementation used all kinds of tricks to make sure that I/O never blocked the single native thread. When these tricks failed, the VM would hang until the I/O request completed.
BTW, it turns out that a one-to-one mapping of VM to native threads isn't optimal either, because native threads tend to have quite a bit of overhead. The current production release of the Solaris VM uses multiple native threads, with each native thread servicing a number of VM threads.
John Brewer
Jera Design

From:
http://www.mail-archive.com/advanced-java@xcf.berkeley.edu/msg04550.html
This is a Solaris discussion:
http://godzilla.cs.nwu.edu/info/java/tooldocs/solaris/threads.html
HI ,
COULD ANY ONE PLEASE LEMME KNOW ANY LINK THAT 'LL GIVE COMPLETE INFO ON GREEN THREAD ??
ANY WHERE ON NET ...
PLEASE LEMME KNOW....
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 19, 2017 02:12:27.