---
title: "Short note: Mach"
subject: "Distributed System"
chapter: 10
key: "semester_7/distributed_system:mach-note"
source: https://www.bctengineer.com/q/semester_7/distributed_system/mach-note
site: BCT Engineering
---

# Short note: Mach

Distributed System · Chapter 10: Case Studies

- Asked in: 2076 Chaitra, 3 marks; 2073 Shrawan, 3 marks; 2074 Asoj, 4 marks; 2076 Asoj (asked 4 times)
- Video: [Mach](https://www.youtube.com/watch?v=BLFw9zobTpU) — Ekeeda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/mach-note
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-10

## Question

Write a short note on Mach.

## Short answer

Mach is a microkernel OS from Carnegie Mellon supporting distributed and parallel computing. Its kernel provides tasks, threads, ports and messages for IPC, and virtual memory with external pagers; other services run as user-level servers. It influenced OSF/1, NeXTSTEP, and macOS.

## Answer

**Mach** is a microkernel-based operating system developed at Carnegie Mellon University (from 1985 onwards). It supports distributed and parallel computing, and is the basis of systems such as OSF/1, NeXTSTEP and macOS (XNU).

**Main features**
- **Microkernel**: only the essential services are in the kernel (processes/threads, memory management, IPC); other services, such as file systems, run as user-level servers.
- **Tasks and threads**: a *task* is an address space and resource holder; *threads* are the units of execution inside a task and are scheduled by the kernel.
- **Ports and messages (IPC)**: a *port* is a protected kernel message queue, and tasks communicate by sending messages to ports. Access to a port is controlled by *port rights* (send, receive). Port rights can be passed between tasks in messages, and ports work transparently across the network through a **network message server**.
- **Virtual memory**: supports memory objects, copy-on-write, and *external pagers*, so user-level programs can manage the backing store; memory can be shared between tasks.
- **Multiprocessor and distributed support**: threads run on several processors; network message servers give location transparency.

```text
 User tasks, servers (file, network)
 ----------------------------------
 Mach microkernel: tasks, threads,
     ports/IPC, virtual memory
 ----------------------------------
 Hardware
```
Because of its modular design, Mach is portable and flexible, but its heavy use of message passing makes it slower than monolithic kernels.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is kept in the Mach microkernel?
   A. All file systems and drivers
   B. Only essential services such as threads, memory management and IPC
   C. Only the network stack
   D. The user applications
   Answer: B. Other services like file systems run as user-level servers. (Key point: Microkernel)

2. What is the difference between a Mach task and a thread?
   A. A task is an execution unit, a thread holds resources
   B. A task is an address space and resource holder, threads execute within it
   C. They are identical
   D. A thread is a port
   Answer: B. Tasks hold resources; threads are scheduled units of execution inside a task. (Key point: Task and thread)

3. What is a Mach port?
   A. A hardware socket
   B. A protected kernel message queue accessed by port rights
   C. A virtual memory page
   D. A thread scheduler
   Answer: B. Messages are sent to ports, and send/receive rights control access. (Key point: Ports)

4. Why is Mach generally slower than monolithic kernels?
   A. It lacks virtual memory
   B. Services communicate by message passing
   C. It has no threads
   D. It runs only on one CPU
   Answer: B. Modularity costs performance because services use message passing. (Key point: Trade-off)
