A thread is one of multiple technologies that allow concurrent execution of Multiple Code paths in a single application. Although newer technologies such as operation objects and Grand Central Dispatch (GCD) provide a more modern and efficient infrastructure for multi-core concurrency, however, Mac OS X and IoS also provide a set of interfaces to create and manage threads.
This document introduces the available thread packages on Mac OS X and demonstrates how to use them. This document also describes the technologies related to multi-threaded Code Synchronization in your application.
Important: If you are creating a new application, we encourage you to study the alternative method for implementing concurrency on Mac OS X. If you are not familiar with the design technology that requires implementing a multi-threaded application, we encourage you to do that. These alternative methods simplify a lot of work that you originally needed to implement the concurrent path and provide better performance than traditional threads. For more information about related technologies, see the concurrency programming guide.
Structure of this document
This document contains the following chapters and appendices:
- "Multithreading programming" introduces the concept of multithreading and their roles in application design.
- "Thread management" provides information about the Thread Technology on Mac OS X and teaches you how to use them.
- "Run loops" provides information on how to manage cyclic event processing in the auxiliary thread.
- Synchronization introduces synchronization problems and tools you can use to prevent multithreading from damaging your data or causing your program to crash.
- The thread security summary provides a high Summary of the inherent thread security in Mac OS X and iOS and their main frameworks.