As we all know, in the development process should be as much as possible to reduce the user waiting time, so that the program as quickly as possible to complete the operation. However, no matter what language development program is eventually converted into assembly language and then interpreted as machine code to perform. But the machine code is executed sequentially, and a complex multi-step operation can be performed sequentially, in sequence, step by step. There are two ways to change this situation: for a single core processor, multiple steps can be placed on a different thread, so that other successor tasks that the user completes after the UI operation are in other threads and continue to execute when the CPU is idle, while other operations can continue for the user at this point, and for the multi-core processor, If the user completes an operation in the UI thread, the other subsequent actions continue in another thread, and the user can continue to perform other UI operations, while subsequent tasks from the previous operation can be dispersed across multiple idle CPUs (depending on the program, of course). and solve the thread blocking and improve the running efficiency. Apple has started using a dual-core A5 processor from iPad2 (iphone 4S), and A7 has joined the coprocessor, and it's really worth thinking about how to make the most of the processor's performance. Today will focus on the development of iOS Multithreading:
First, a brief introduction
Creation of Threads:
Copy Code code as follows:
Self.thread=[[nsthread alloc]initwithtarget:self selector: @selector (test) Object:nil];
Description: There are a number of ways to create a thread, and there is no excessive introduction.
Opening of Threads:
Copy Code code as follows:
The above content is small to introduce the iOS multithreaded development of the state of the thread, I hope you like.