• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Daemon Thread

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is Daemon thread?
What happens when we run more then one program simultaniouly with one main JVM thread.
Can someone explain plz!!!
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Threads Forum.
This forum is for management issues relating to the JavaRanch site itself.
[ August 06, 2003: Message edited by: Cindy Glass ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Weird -- someone else just asked "what are daemon threads" this morning.
The definition of a daemon thread is just this: if all the threads running in a JVM are daemon threads, the JVM will exit. That's it. So if you want to create a "background" thread to do some repetitive task, but you want your program to exit as soon as main() returns, then make that background thread be a daemon thread.
As far as your second question: is it "What happens when you run multiple JVMs?" or "What happens when you run multiple threads in one JVM?" In either case, nothing remarkable; if you understand what a JVM is and what a Thread is, you should already know the answers.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic