Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

deamon

 
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
 
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!.
 
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
 
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
 
Our first order of business must be this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic