daemon thread

The fork join framework in java

Preface Fork join framework is the introduction of java 7 framework, the introduction of this framework is mainly to improve the ability of parallel computing. Fork join has two main steps, the first is fork, a large task into many small tasks, the second is join, the results of the first task join up to generate the final result. If there is no return value in the first step, join will wait until all the small tasks are finished.

Daemon Thread in Java

Preface There are two types of threads in java, user threads and daemon threads. User threads are high priority threads and the JVM will wait for all the User Threads to finish running before it finishes running. daemon threads are low-priority threads that serve User Threads. Because daemon threads are low priority and serve only user threads, the JVM will automatically exit when all user threads are finished, regardless of whether there are still daemon threads running.