1

Possible Duplicate:
Green Threads vs Non Green Threads

How many kinds of threads do java support as far my knowledge there are two types of thread user threads and daemon threads but I was reading an article which states that ...

Proper threads: these are abstractions around the underlying operating system's threading facilities. Thread creation is, therefore, as expensive as the system's -- there's always an overhead.

and the other one is

"Green" threads: created and scheduled by the JVM, these are cheaper, but no proper paralellism occurs. These behave like threads, but are executed within the JVM thread in the OS. They are not often used, to my knowledge.

Please advise what are green threads are they same as daemon threads?

Community
  • 1
  • 1
user1633823
  • 347
  • 2
  • 5
  • 14
  • 1
    green threads have not been in use for over 13 years or so... they were introduced in java1.1 running on Solaris. And No daemon thread are totally different. – bestsss Sep 02 '12 at 09:56
  • 1
    What are these green threads you speak of? Do they have a reduced energy consumption? – Tudor Sep 02 '12 at 10:15
  • If its not clear, green thread were never available for Windows or Linux. – Peter Lawrey Sep 02 '12 at 10:42

1 Answers1

0

two types of thread user threads and daemon threads

Daemon threads are regular threads (they are even created identically), except that the app does not need to wait for them to finish before exiting. I even question the wording from the docs, because to me daemon threads are user threads (i.e. Thread instances).

Green threads are completely obsolete and had nothing to do with daemon threads.

Tudor
  • 61,523
  • 12
  • 102
  • 142