Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is Green Thread?  RSS feed

 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I read somewhere that Green thread is a default Java thread or the user defined thread.
What is the meaning of this?
Kindly explain.
Regards,
Guru
 
Chris De Vries
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an article which addresses this exact topic on Sun's website. Here's the link.
I hope this helps.
Chris
 
Apan Raj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The document explained the advantages of Native Thread over Green thread.
Can you let me know how and who decides between creating Green thread and Native thread.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Green threads" is a library that implements threads. It was very weak, with no real concept of preemption -- it's a "cooperative multitaking" implementation. It was used in the original JVMs because Solaris didn't have native thread support at time (nor, I don't think, did Windows, but I'm not sure.) As various OS's came to include native threading libraries, using the Green threads library became an option, to be used only if the native platform turned out to be broken. Nowadays I don't thnk it's even offered as an option in most of Sun's JVMs.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!