Linked by Thom Holwerda on Fri 2nd Sep 2005 09:44 UTC
Talk, Rumors, X Versus Y "We will shed more light on the whole Apple versus x86 PC, IBM G5 versus Intel CPU discussion by showing you what the G5 is capable of when running Linux. This gives us insight on the strength and weakness of Mac OS X, as we compare Linux and Mac OS X on the same machine."
Permalink for comment 26793
To read all comments associated with this story, please click here.
Deceiving.
by bryanv on Fri 2nd Sep 2005 18:16 UTC
bryanv
Member since:
2005-08-26

Alright. Let me pick this apart.

First of, OS X is a Mach kernel, not a BSD kernel.

The BSD subsystem runs as a service (process, thread) ON TOP of the Mach kernel.

pthreads is a common (often lowest common denominator) threading library. There are pthreads implementations for BSD, Linux, etc.

It's reasonable to assume that the pthreads implementation that MySQL is running upon is running on the BSD subsystem in OS X, which is most likely (from what I understand) running as a single process on the Mach kernel. See how this is going?

Mach
|-> Mach Thread (BSD subsystem)
| |-> Pthread
| |-> Pthread
| |-> Pthread
|-> Other Mach thread (Native OS X application)
|-> Other Mach thread
|-> Other Mach thread

Now let's say that Mach only knows about the mach threads (totally reasonable to assume) it's going to schedule the BSD subsystem as a single process (which it is). This means anything running the BSD subsystem is going to be splitting up the time used by a SINGLE Mach thread. Performance hit? Uh. YEAH.

I'm completely unsure of the state of the OS X BSD subsystem in relation to the BGL from FreeBSD, which may further complicate I/O functions in regards to everything getting scheduled as a single process in the Mach kernel.

Linux, on the other hand has a native pthreads wrapper that maps pthreads 1 to 1 with linux threads.

Compare a compile of MySQL on OS X that uses a pthreads -> Mach thread wrapper, and uses native OS X / Mach (not BSD subsystem) API's to MySQL on Linux and _then_ I'll consider this a valid comparison.

Untill then, you're bitching that a platform emulation layer isn't working as fast as the real platforms do.

Reply Score: 2