[rescue] OS X and dual CPU machines?
Francisco Javier Mesa-Martinez
lefa at ucsc.edu
Mon Jun 9 03:00:18 CDT 2003
Please every one should remember that not all threads are created equal.
There are 2 major approaches when it comes to "threading"
1) User thread: Usually implemented as a set of libraries, which I am
guessing is what OSX employs (note just a guess!). These are implemented
entirelly in user space. Thus fork and join is quite fast, and since it
is all done under the same address space (the parent process's) we have
lightweight context, i.e. cheap context switch per thread.
2) Kernel threads: Usually implemented at the kernel level and provides
services for user threads. This is what solaris does. Therefore one thread
blocked by the kernel does not block other threads from the same process.
All threads are schedule by the kernel thus there is slight speed increase
albeit there may be some rerource penalty.
The way to think of it, is in 1) you can apply several threads to a single
processor, while in 2) you can distribute a single process among several
processors. This is why well threaded code flies in solaris... I really do
not know what OSX does though....
More information about the rescue