Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

daemon thread and heavyweight concept

 
sam mitwa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between daemon thread and user thread
i m not able to get it
please help me

and why we say thread as heavyweight process;
and what is light weight process
i m madly confused between these concept
i just crammed not understood
can anybody help me
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A User Thread will always run to completion, whether that completion happens normally or because of some abrupt termination (such as an unchecked/uncaught exception).

A Deamon Thread will run until it completes or until all User Threads have completed. Daemon threads make excellent "behind the scenes" processes for things that must happen in the background but can be terminated when the application ends - garbage collection is a great example of a process that could be handled with a daemon thread. Once all User Threads complete, any Deamon Threads that are still running are automatically halted and the application terminates.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic