Using the NSThread Class
Several features of the Application Kit make use of threads. For example, in the previous NSTask examples, the task itself is actually run from a separate thread. Many of the animations in Aqua, such as throbbing buttons and progress meters, are also run from other threads. All these threads are entirely transparent to the programmer. For programmer-controlled threads, however, the NSThread class is the Cocoa interface to the operating system’s thread functionality. On Mac OS X, the pthreads library is the underlying functionality being tapped. Although the full functionality of pthreads is not available through the NSThread interface, the careful programmer can get away with calling the pthread functions when and if ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access