Four states of a thread
1 generation (new): The thread object has been generated but has not been started, so it cannot be executed, and the start () method is not called after the object is generated by new.
2 executable (Runnable): Each multithreaded system has a scheduler, the scheduler selects a thread from the thread pool and starts it, when a thread is in the executable state, it may be in the thread pool waiting for the scheduler to start it, or it may be executing. If a thread object's start () method is executed, the thread is in an executable state. However, it is clear that the thread may not be in the execution. Have execute permissions, but not executed.
3 Stagnation (Blocks): When a thread is stuck, the system scheduler ignores it and does not schedule it. When a stalled thread returns to its executable state, it may be re-executed. If you call the Wait () method on a thread, the thread goes into a standstill state. Only this call to notify () or Notifyall () can return it to the executable state.
4 Death (Dead): When a thread ends normally, it is in a dead state, such as when a thread's run () method finishes executing.
Multithreading (iii)