Tuesday, July 30, 2002 09:33 PM
The main thread (JVM) waits for all threads (started within the process) to exit before it exits. However, if you mark any created threads as daemon, the JVM no longer waits for those threads to exit. Instead it goes ahead and exits and as a result those daemon threads also exit (no threads can keep running if the process which started them has exited).
In java, creating daemon process running in the background is possible if a class runs in a infinite loop and is started using javaw.