Hi All, I just found someone passed SCJP exam and mentioned deamon in the real test. But I have no idea about deamon. Also RHE doesn't mention it. Should I be prepared fo it? Mike
chetan nain
Ranch Hand
Joined: Jun 21, 2000
Posts: 159
posted
0
the term daemon is defined in the context of threads (in java). 1. daemon threads exist to serve user threads. 2. an example of a user thread is the main thread. 3. a daemon thread is implicitly created prior to creation of the user thread. 3. a thread may be set as a daemon thread using the setDaemon() method of the Thread class. this method has boolean return type. 4. however, invocation of above method on a running thread results in IllegalThreadState exception. thats about all i can share
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi, Chetan! Thank you for your help. Now I know something about Daemon. Mike
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Ajith is it possible for you to give some more explanation on Daemon Thread. Really appreciate your help.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Let me add something to this. setDaemon() marks this thread as either a daemon thread or a user thread. JVM will exit when the only threads running are all daemon threads. This method must be called before the thread is started.
Subha, I guess you found what you wanted. daemon threads have been discussed here before more than once. You are always welcome to ask specific questions if you have any Ajith
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).