Forums Register Login

Daemon Thread

+Pie Number of slices to send: Send
What is Daemon thread?
What happens when we run more then one program simultaniouly with one main JVM thread.
Can someone explain plz!!!
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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.
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1497 times.
Similar Threads
Daemon Thread
Daemon threads & non daemon Threads
Daemon Thread
how to generate a deamon thread in java
Daemon threads
3 questions regarding JPanel.
daemon Vs User Thread
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:34:59.