Java ineterpreter exits only wen there is daemon threads r running

Can any one tell me why this happns?...How does the interpreter know that daemons r no more valuable?....
[112 byte] By [ttrra] at [2007-10-3 8:54:57]
# 1

> Can any one tell me why this happns?...How does the

> interpreter know that daemons r no more

> valuable?....

It doesn't "know" anything about how "valuable" any thread is. The threading facility was just designed such that there are two categories of thread, and a thread of one category is enough by itself to keep the VM running, while a thread of the other category (daemon) is not.

In other words, a deamon thread is, by definition, one that you use when you don't want that thread alone to be enough to keep the VM running.

jverda at 2007-7-15 4:05:01 > top of Java-index,Java Essentials,Java Programming...
# 2
Then in which senarios daemons r useful?
ttrra at 2007-7-15 4:05:01 > top of Java-index,Java Essentials,Java Programming...
# 3
A typical daemon thread speands most of it's time waiting for something to happen, for example it might do something every minute, or it might wait for tasks to be put on a queue. When the rest of the program closes down it become irrelevant.
malcolmmca at 2007-7-15 4:05:01 > top of Java-index,Java Essentials,Java Programming...