There are two types of threads: 1. Daemon thread; 2. User thread;
1. Daemon Thread: The daemon thread is the thread that values the thread property Isdaemon's state is true, and the primary role is to provide conditions for the execution of the user thread. Typical applications for daemon threads are Java garbage collection.
The main features are:
A. The thread property Isdaemon has a status of true.
B. When there is no user thread running in the JVM application, the daemon thread ends the run.
C. Turn the thread into a daemon thread by setting the thread's method Setdaemon (true), but the method must be executed before the start () method, after the startup thread, cannot change the thread type halfway
D. If you use the thread pool framework executeservice, the daemon thread will be changed to the user thread, and the priority of the thread will be set to the priority of the normal thread. Executeservice is primarily used to manage threads, and cannot create threads.
E. The daemon thread is transitive, and when the thread is set to a daemon thread, its child threads are also the daemon threads.
2. User thread: The user thread is the thread that we created ourselves when we programmed it, and the thread property Isdaemon to True.
For more detailed information about the daemon thread, refer to this blog: http://blog.csdn.net/u013256816/article/details/50392298
Summary of features of the daemon thread