Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deamon

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Chetan!
Thank you for your help. Now I know something about Daemon.
Mike
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajith is it possible for you to give some more explanation on Daemon Thread.
Really appreciate your help.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This Discussion is nice.
http://www.javaranch.com/ubb/Forum24/HTML/001830.html
Now I got some basic idea about this. If anyone wants to learn more just give a search on deamon and read. Really interesting!.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marcela Blei
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at my last reply please. I founded a wrong concept http://www.javaranch.com/ubb/Forum24/HTML/001830.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic