1. Underlying 1.1 threads for concurrent programming-process/priority
The smallest unit of operating system scheduling is a thread, and the thread is a lightweight process.
The thread priority is set by the setpriority (int) method, which has a default priority of 5 and a rank of 1~10. The higher the grade, the more time slices.
1.2 Status of the thread
New initialization "runable run" "Blocked block" "Wating Wait" "Time_wating timeout Wait" temerinated the end of the state.
1.3 Daemon worker Thread
The worker thread ends after the main thread terminates. Thread.setdaemon (True) to set before thread start.
1.4 Expired Suspend (), resume (), stop () Why is it not recommended?
Suspend () after the call too overbearing, do not release the possession of resources, but holding the possession of resources to sleep, so easy to deadlock. Standing manger don't poop.
Resume (), stop () does not guarantee the normal release of thread resources, how do you use?
Anatomical java-Concurrent Programming