Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
Like this article? We recommend

6. You criticize UNIX and say that Mach has some features it lacks, but isn’t Mach a form of UNIX?

I have something of a soft spot for Mach. It is a perfect example of why you should never let theoreticians design real software, but on paper it is a thing of beauty.

The Mach microkernel was highly experimental and made a number of design decisions that turned out, in retrospect, to be very bad. The most notable relates to port rights.

All interprocess communication in Mach (including most interaction with the kernel) happens via ports—things that can have messages written to them. Each process has a set of permissions for various ports determining whether it is allowed to read or write from them. Every time you write to a port, the kernel checks that you are allowed to do so, and then lets you if you are.

This sounds sensible—you don’t want arbitrary people writing into your IPC mechanisms. Unfortunately, it turns out that this permission checking is rather an expensive thing to do. Worse, it turns out that 90 percent of the time it isn’t of much use. A better solution is to add some information about the message sender to the message, and allow the receiver to do the checking if it wants to. Going the Mach route makes system calls in Mach-based systems (including OS X) about 10 times more expensive as in other systems.

The point of this has been to reinforce the idea that Mach is not UNIX. It is possible to build a UNIX-like system on top of Mach in the same way that it is possible to build a DOS or OS/2-like system on top of Windows NT, but Windows NT is not DOS or OS/2.

  • + Share This
  • 🔖 Save To Your Account