File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

daemon

 
Syamsul Hussin
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic