Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do we make a green thread  RSS feed

 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

How do we implement a green thread , is it like any other user thread in java , or is there any thing special to it .

Can i make a user thread , a green as we can make deamon thread from user thread or vice versa

If possible give one small working example

Regards
 
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
You can't "make a green thread", nor can some threads in an application be "green", while other aren't. A Java Virtual Machine needs to be built on top of some "real" thread library -- i.e., a thread library in native code. The earliest JVMs used a library called "Green threads", which was relatively crude, but also relatively portable, and it was a good way for Sun to get a JVM working on a number of platforms early on. As time has passed, and operating systems have matured, Sun's JVMs (and those from other vendors) have more or less universally transitioned to using the OS's standard or built-in thread implementation. At first, these "native thread" JVMs had some problems, mostly due to the immaturity of the underlying libraries, but things have improved greatly over the years. Thankfully, Sun is no longer shipping JVMs that use Green threads. This is a Good Thing.
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx ,

I got the point .


regards
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learn something new every day.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!