| Author |
Is knowledge of Daemon threads required for 1.4?
|
Brian Joseph
Ranch Hand
Joined: May 16, 2003
Posts: 160
|
|
|
I noticed a couple of questions on these, and my book did not cover them. Is it worth knowing these for the 1.4 exam?
|
 |
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
|
|
Daemon threads aren't really that different from a normal thread. The key is that they are then dependent upon another process. When that thread dies, so too, does the daemon thread. I would expect daemon threads to appear on the exam.
|
SCJP Tipline, etc.
|
 |
Jessica Sant
Sheriff
Joined: Oct 17, 2001
Posts: 4313
|
|
|
I think the main things you need to understand about Daemon threads is that the JVM will exit once there are no non-Daemon threads (user threads) running. Also, when you spawn a thread it will get the same status as the thread that created it, unless explicitly set using setDaemon(boolean).
|
 |
Anupam Sinha
Ranch Hand
Joined: Apr 13, 2003
Posts: 1088
|
|
setDaemon(boolean) can only be used if the thread has not been started. [ June 20, 2003: Message edited by: Anupam Sinha ]
|
 |
Brian Joseph
Ranch Hand
Joined: May 16, 2003
Posts: 160
|
|
|
Thanks for those quick tips!
|
 |
 |
|
|
subject: Is knowledge of Daemon threads required for 1.4?
|
|
|