What is Daemon?

Baidu translates the meaning of the word "guardian wizard" in Baidu translation. In Java, daemon means guardian thread.

A daemon thread is a special thread, just like its name. It is the guardian of the system and silently completes some system services in the background, such as a garbage collection thread. The JIT thread can be understood as a daemon thread.
The opposite of the daemon thread is the user thread. The user thread can be considered as the working thread of the system, and it will complete the salesman operations to be completed by this program. If all user threads are finished, it means that the program has nothing to do. The object to be guarded by the daemon thread no longer exists, so the entire application should end. Therefore, when there are only daemon threads in a Java application, the Java virtual machine naturally exits.

 

Guess you like

Origin blog.csdn.net/mid_Faker/article/details/110350098