• 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
  • 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

daemon

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i was reading the API for thread. What is a daemon? how does it differ from normal threads? how can we use them and when should we use them? thanks
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Syamsul,
A daemon is a term we get from Unix. It is essentially a process that runs in the background unbeknownst to the user, like rlogind. A Java daemon thread is a thread that will not prevent the JVM from exiting when all the non-daemon thread are finished. For example if Threads A and B are non-daemons and Threads C, D and E are daemons and no other threads are running, when Threads A and B finish, the JVM will exit. I personally like to set all worker threads to daemons so that there is no chance that they can prevent the JVM from exiting.
Michael Morris
[ March 07, 2003: Message edited by: Michael Morris ]
[ March 07, 2003: Message edited by: Michael Morris ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic