Today’s Technical Tip of the Day allows us to supply four Words for the Day: “I have a dual processor G4 Macintosh and I’d like to know more about how the Mac uses the two processors?”
To understand how a newer dual processor G4 manages information between the two processors, it’s best to understand the following principles and how they interact.
Preemptive multitasking – Preemptive multitasking lets an OS dynamically adjust processing priorities between tasks and applications on an as-needed basis, as opposed to cooperative multitasking where the applications decide. The act of taking control of the operating system from one task and giving it to another task is called preempting. A common criterion for preempting is simply elapsed time (this kind of system is sometimes called time sharing or time slicing). In some operating systems, some applications can be given higher priority than other applications, giving the higher priority programs control and perhaps longer time slices as soon as they are initiated. The result is you can run several processor-intensive applications all at the same time. You can, for example, burn a DVD in the background while editing audio and checking your email.
Cooperative Multitasking – A computer multitasking environment in which a program running in the background can only receive processing time when the program in the foreground allows it, as opposed to preemptive multitasking where the OS determines the processor allocation. Generally in cooperative multitasking environments, an application can give up control of the processor to another application only at certain points, such as when it is ready for input from the keyboard. This method of multitasking may allow one program to dominate the computer’s resources so other programs have limited access to the CPU. It is also called non-preemptive multitasking.
Symmetric multiprocessing – Symmetric multiprocessing takes the preemptive multitasking principle to the next level by managing processing priorities between two processors. In effect, the OS sees each processor as a resource that can be used for either operating system or application needs and arranges tasks between processors for maximum efficiency. For example, one could encode an MP3 file on one processor, while an email application and an video-editing application run on the second processor. In this way, different tasks can be completed simultaneously — and faster than ever — on a dual processor system.
Multithreading – An offshoot of multitasking, multithreading is where processes taking place in a computer system are broken down into subprocesses, often called threads, for more efficient handling by the system. It allows a program or OS to manage its use by more than one user at a time or to manage multiple requests by the same user without having to run multiple copies of the programming. Each “thread” is kept track of by the system, and within limits many threads or discrete operations can appear to be happening simultaneously, which makes multitasking more transparent to the user.
The G4 Macintosh with OS X uses preemptive multitasking, symmetric multiprocessing, and multithreading to maximize system efficiency. These system-level features pay off big time when you’re running heavy-duty science, engineering, audio, or video and 3D modeling applications in Mac OS X. For example, when you render a transition between two clips of HD video, the process entails decoding the first clip, decoding the second clip, rendering the transition and then re-encoding the transition into the original format. In Mac OS X, the two clips can be decoded at the same time, one on each processor. Later, while the transition is rendering on one processor, finished frames can be re-encoded on the second processor. Because threads are processed in parallel, the task is completed in significantly less time.
Please note that for the most part, developers have to write software for their applications to take full advantage of a dual processor system and that this is not a small task in most situations. While some already do, look for more audio and MIDI applications to take advantage of multiple processor systems (Mac & PC) in the very near future.