• Post Reply 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Daemon Thread

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear ALL,

Could you pls anyone explain about 'Daemon Thread' ?And where is it used?

Kind regards,
Senthan
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Daemon threads are low priority threads that provides some service to an application. Garbage Collector thread is an example of daemon thread.
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Srinivasa Raghavan:
Daemon threads are low priority threads that provides some service to an application. Garbage Collector thread is an example of daemon thread.



Actually, the daemon or non-daemon status is completely unrelated to the priority.

As is clearly documented in the Java API/Spec (RTFM), the daemon or non-daemon status of a thread determines how the thread affects JVM shut-down. The JVM will not shut down while any non-daemon threads are running. In contrast, daemon threads do not prevent shut-down.

Daemon threads are often used for background, clean-up tasks or for services. Sometimes they are run at low priority, but that choice depends on the application.
 
Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic