| Author |
Query about Daemon thread.
|
Ganesh Prakhya
Ranch Hand
Joined: May 05, 2004
Posts: 76
|
|
Hi, Can anybody explain me the difference between User Thread and Daemon Thread in terms of execution? Thanks in advance, Ganesh
|
 |
patrick J. d'cousta
Greenhorn
Joined: Oct 25, 2005
Posts: 24
|
|
The only diffrence between daemon thread and user thread is daemon threads are for serving user threads.That is if all the user threads get over then all the daemon thread are terminated and application exits. Example garbage collector thread
|
 |
Ganesh Prakhya
Ranch Hand
Joined: May 05, 2004
Posts: 76
|
|
Hi patrick J. d'cousta, But, if I create an user thread and a daemon thread, what advantages I have with daemon thread over user thread? In otherwords, when we need to create/use daemon threads? Thanks in advance, Ganesh..
|
 |
patrick J. d'cousta
Greenhorn
Joined: Oct 25, 2005
Posts: 24
|
|
Ganesh Imagine u are writing a application where there are two tasks 1.Number of thread do some work and dump the output in a directory 2.One thread is supposed to run once a while and purge this output 1 are all user threads 2 is a daemon thread.
|
 |
Ganesh Prakhya
Ranch Hand
Joined: May 05, 2004
Posts: 76
|
|
|
Now its clear to me. Thank you.
|
 |
 |
|
|
subject: Query about Daemon thread.
|
|
|