Multithreading has been in the MacOS for a long time through a set of APIs called the "Thread Manager". The threads are cooperative, not preemptive. This means you must occasionally call YieldThread() to give time to other threads in the application or to the system. It works surprisingly well, provided all the apps on the machine make an effort to play nice with each other. A single greedy application can prevent any of the others from getting any time (excepting MP tasks, which are explained latter). One real advantage of cooperative threading is that you don't have the same kind of synchronization problems that you do with preemptive threads - a simple golbal variable to indicate a resource in use will suffice. On the other hand, giving other threads/processes time while waiting on I/O requires you to use asynchronous I/O techniques, which are not generally well-understood by most programmers. Preemptive threads and MP support have also been available (via the Multiprocessing APIs) for quite some time, with an important caveat. Until recently, few of the MacOS system calls were reentrant. A mechanism is provided in the API for indirectly calling important functions (disk i/o, etc.) but those were somewhat expensive to use. Still, data-intensive routines that could be parallelized got a big boost from using the MP APIs. MP threads (called "Tasks") are properly scheduled even if some of the cooperative apps/threads are being piggish about the processor(s). MP machines (boxes with more than one CPU) have been available off and on for a long time now, but that's another saga in itself. But only one processor was generally used unless some application decided to employ the MP APIs. Last week Apple demonstrated a two-processor G4 at the developers conference. It is still unknown when these beasts will actually ship. I just know I want one! MacOS X and the Carbon APIs mark a huge improvement in the OS. The kernel is Mach 3 and BSD 4.4. The old MacOS interfaces have been unburdened of much of the cruft from 16 years of evolution, and the surviving/mutated APIs are now dubbed "Carbon". They are reentrant, which means you can actually use the MP threads (aka Tasks) without jumping through hoops. Programmers who can't quite wrap their heads around the synchronization issues inherrant in preemptive-thread programming can still use the ThreadManager's cooperative threads. Regardless, all apps are preemptively scheduled and run in separate memory spaces, so Joe Shmoe's app can't interfere with Jane Shmane's apps.
Multithreading has been in the MacOS for a long time through a set of APIs called the "Thread Manager". The threads are cooperative, not preemptive. This means you must occasionally call YieldThread() to give time to other threads in the application or to the system. It works surprisingly well, provided all the apps on the machine make an effort to play nice with each other. A single greedy application can prevent any of the others from getting any time (excepting MP tasks, which are explained latter). One real advantage of cooperative threading is that you don't have the same kind of synchronization problems that you do with preemptive threads - a simple golbal variable to indicate a resource in use will suffice. On the other hand, giving other threads/processes time while waiting on I/O requires you to use asynchronous I/O techniques, which are not generally well-understood by most programmers. Preemptive threads and MP support have also been available (via the Multiprocessing APIs) for quite some time, with an important caveat. Until recently, few of the MacOS system calls were reentrant. A mechanism is provided in the API for indirectly calling important functions (disk i/o, etc.) but those were somewhat expensive to use. Still, data-intensive routines that could be parallelized got a big boost from using the MP APIs. MP threads (called "Tasks") are properly scheduled even if some of the cooperative apps/threads are being piggish about the processor(s). MP machines (boxes with more than one CPU) have been available off and on for a long time now, but that's another saga in itself. But only one processor was generally used unless some application decided to employ the MP APIs. Last week Apple demonstrated a two-processor G4 at the developers conference. It is still unknown when these beasts will actually ship. I just know I want one! MacOS X and the Carbon APIs mark a huge improvement in the OS. The kernel is Mach 3 and BSD 4.4. The old MacOS interfaces have been unburdened of much of the cruft from 16 years of evolution, and the surviving/mutated APIs are now dubbed "Carbon". They are reentrant, which means you can actually use the MP threads (aka Tasks) without jumping through hoops. Programmers who can't quite wrap their heads around the synchronization issues inherrant in preemptive-thread programming can still use the ThreadManager's cooperative threads. Regardless, all apps are preemptively scheduled and run in separate memory spaces, so Joe Shmoe's app can't interfere with Jane Shmane's apps.