Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Threads in Java

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
How many thread types are in java?(i know only one daemon thread)
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi
These are some of the JVM thread types, I know :

1. Daemon threads - used in the background to implement a service. To create daemon thread thread.setDaemon(true). JVM exits when the only running threads are daemon.

2. Green threads - are pseudo threads. These are user level threads. Sun wrote green threds to enable thread support where native threds cannot be used. But I am not sure, if that means that green threads **CANNOT** be time sliced or round robin'ed. However this should depend strictly on the scheduler.

3. Native threads - To create native thread you need to run native VM use "-native" option. These threads can definitely be scheduled by OS scheduler.

I am not sure if Sun's Hot Spot VM still uses green threads on Solaris. But if they do then I think it shouldnt run faster than native implementation.

Cheers
Nishant
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic