Process state switching:
There are five main states of a process: new, ready, run, blocked, and destroyed. The diagram below:
Strictly speaking, the process also has a pending state, mainly to solve the problem of insufficient memory resources. If an end user request, a parent request, or load regulation all require the use of the pending state. The diagram below:
In the two states of ready and blocking, static ready and active ready, as well as static blocking and active blocking are distinguished. The inactive and active states can be switched between by activating and suspending, while the running state can be switched to the inactive ready state by suspending.
Thread state switching:
Thread is the micro performance of the process, so the state of the thread is basically the same as the state of the process, and the switching conditions are basically the same. The diagram below: