This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Daemon threads  RSS feed

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doubt. Does all threads created by the JVM are daemon threads?. I think it is true. Can anybody help me to resolve this!
TIA
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No unless you issue a method setDeamon(true) then the thread becomes deamon(user Threads)
 
natarajan meghanathan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
user threads are non-daemon threads. What i wanted to know is that whether all the threads run by the JVM on the background (eg. we know gc is a daemon thread) are daemon threads.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok i dind' tget your question , and i am not doing well with threads yet. But is this a user Thread if i create my own ?
Thread d = new Thread(this);
d.setDeamon(true);
d.start();
Now is this a deamon thread ? I believe it comes a deamon and isn't it a user thread ?
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
All the threads spanned by JVM are not Daemon threads.
Eg: main()
 
Priya Kannan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Val,
Yep.It's a 'user' turned 'Daemon'!!!
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi priya,
main thread is not a demon thread,but what about other threads that run in the background.
eg the ReferenceHandler thread,the Signal dispatcher thread etc.... as the JVM is said to start four threads for an application in the absence of a GUI.
could u please throw some light on this.
Vijay Pillai
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!