Threads generally can be divided into five states:
1> new state has just been created, not yet used, that is, the following code just ended the moment the state of the thread.
Nsthread *thread = [[Nsthread alloc] initwithtarget:self selector: @selector (run) Object:nil];
2> ready state: The thread system that you just created will do some work, and the thread will be joined to a pool of scheduled threads waiting to be used, when the thread is in the ready state.
3> running state: After [thread start], thread is running, the appropriate point is in the processing of tasks, such as downloading tasks, has been downloaded, no rest, and blocking the status of comparison
4> dead state: Thread task execution complete, or exception \ Force exit after the thread is destroyed! If the task is performed properly, the thread enters the scheduler pool.
At this point, if the system thread is not tense and there is no task waiting for the system to create the thread, then the system will move the thread out of the scheduled thread pool and the threads are destroyed.
If there are many tasks waiting to create a thread to process, then the system will not talk about threads removing the scheduler thread pool to destroy him, but directly let him perform the task.
The process of destroying this thread, and creating a new thread, is omitted.
5> blocking state: Call the Sleep method or add a mutex (synchronous lock),
Several states of a thread