[Ti] slightly OT: which apps dual-processor aware?
Chris Olson
chris.olson at astcomm.net
Tue Apr 12 22:22:04 PDT 2005
On Apr 12, 2005, at 9:35 PM, Ronald Woodland wrote:
> I have yet to see one of the CPUs idle while the other one is working.
> The numbers move around and often bounce back and forth as the
> workload is distributed. Dual processors working in beautiful
> cooperation with the robustly stable and fluid Mac OS -- it gives me
> goosebumps just thinking about it.
The Mach kernel does the thread scheduling for the cpu(s). Mach does a
very good job at SMP - it was designed for it. Both Carbon and Cocoa
applications can be multithreaded but Carbon will use Multiprocessing
Services (as in Mac OS 9). Cocoa uses the NSThread class with
NSThread's detachNewThreadSelector:toTarget:withObject
Some applications like Safari will throttle the threads if one requires
the other to be at a certain point before continuing by using condition
locks (NSConditionLock). But if an app uses a lot of condition locks
or passes many objects and messages between threads, application
performance can suffer. Safari, by design, does not benefit from dual
processors. Neither does Mail, Sherlock, iCal, Finder, and most other
every day applications and utilities. Only cpu-intensive tasks and
applications really take full advantage of it. Because of OS X's
pre-emptive multithreading capability, along with the Mach kernel's
capability to schedule and switch threads many times per second on one
cpu, you just don't notice the difference until the total system load
on one cpu reaches 100% cpu time.
--
Chris
More information about the Titanium
mailing list