Nsthread: Create and enable a thread with Nsthread
1. Nsthread *thread = [[Nsthread alloc] initwithtarget:self selector: @selector (run) Object:nil];, called after [thread start];
2. Automatically start thread after creating thread, [Nsthread detachnewthreadselector: @selector (Run) totarget:self Withobject:nil];
3. Create and start the thread implicitly, [Self performselectorinbackground: @selector (Run) Withobject:nil];
Five states of a thread: new/Ready/Run/block/dead, there is a pool of scheduled memory in memory, when the memory is in the ready state is loaded into the dispatch pool, when the thread is blocked, it is moved to memory, during CPU scheduling, the run is switched back to the ready state when the thread runs the end (Exception/force exit) The post thread is not moved out of memory. You can force a thread into a dead state by [Nsthread exit];