• Post Reply Bookmark Topic Watch Topic
  • New Topic

green threads

 
nata bhairavi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What R green Threads? How do they differ froma normal one?
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this topic to the Threads and Synchronization forum, because it's more appropriate in there.
-Peter
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Green threads" refers to a model in which the Java virtual machine itself creates, manages, and context switches all Java threads within one operating system process. No OS thread library is used.
"Native threads" refers to a model in which the Java virtual machine creates and manages Java threads using the OS thread library - e.g. the Solaris thread library - and each Java thread is mapped to one library thread.
Basically in the native case the Java thread concept is a proxy
for a native thread whereas green threads are resident in the VM.
Since all of this dispatching, thread scheduling, stack management, etc. occurs in the one process for the VM - we often
hear of better performance with native threads.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!