Difference:
is relatively lightweight in these ways, but is also the most responsible for the use of, you need to manage the thread's life cycle, synchronization between threads. Threads share part of the memory space of the same application, and they have the same access rights to the data. You have to coordinate the access of multiple threads to the same data, and the general practice is to lock them before access, which can lead to some performance overhead. In IOS we can use several forms of thread.
Use Nsthread or directly from the NSObject class method Performselectorinbackground:withobject: To create a thread. If you choose thread to implement multi-threading, then nsthread is the preferred way to use the official recommendation.
Cocoa operations is implemented based on OBECTIVE-C, and class nsoperation encapsulates what the user needs to do in an object-oriented manner, so we focus on what we need to do, without worrying too much about thread management, synchronization, etc. Because Nsoperation has encapsulated these things for us. Nsoperation is an abstract base class, and we must use its subclasses. Two default implementations of IOS are available: Nsinvocationoperation and nsblockoperation. But when you use nsoperation subclasses to create threads, threads are not really created, need the Nsoperationqueue class, and when a child thread is added to an object in the Nsoperationqueue class, the thread is actually created successfully. This time do not let the child thread to call the Start method, no group program will crush
IOS4 began to support the Pure C language package, providing a lot of very powerful functions. GCD is an Apple solution for multi-core parallel computing that automatically leverages more CPU cores (such as dual-core, quad-core), automatically manages the lifecycle of threads (creating threads, scheduling tasks, destroying threads), and programmers just need to tell gcd what they want to do, without having to write any thread-management code.
The difference between iOS multi-thread nsthread, Nsoperationqueue, NSObject, and GCD