Skip to content
Why Is It Called 'Mutex'? — The Origin of the Term

Why Is It Called 'Mutex'? — The Origin of the Term

DodaTech Updated Jun 20, 2026 4 min read

Computer science has a proud tradition of portmanteaus — smash two words together and you get a new term that everyone instantly understands. Modem (modulator-demodulator). Codec (coder-decoder). Transistor (transfer-resistor). Mutex — mutual exclusion — is one of the finest examples. Say it once and you know exactly what it does: it keeps things out.

The Story

The concept of mutual exclusion — ensuring that only one process at a time can access a shared resource — was formalized by Edsger Dijkstra in 1965. Dijkstra introduced the “semaphore,” a synchronization primitive that used two operations, P (proberen, “to test” in Dutch) and V (verhogen, “to increment”). The semaphore could count resources or enforce mutual exclusion when set to one.

But “semaphore” is a general term (borrowed from railway signaling), and programmers needed a more specific name for the binary lock that protected critical sections. The term “mutex” emerged in the 1970s and 1980s as a contraction of “mutual exclusion,” popularized by the growing field of concurrent programming and the development of threading libraries.

Dijkstra’s earlier work on concurrency included Dekker’s algorithm (1965), the first known solution to the mutual exclusion problem for two threads. It was invented by Dutch mathematician Th. J. Dekker and adapted by Dijkstra. The algorithm used only shared memory and busy waiting — no hardware support needed. Later, Gary L. Peterson published Peterson’s algorithm (1981), which simplified Dekker’s approach into an elegant two-line solution that’s still taught in every operating systems course.

How It Evolved

The mutex became the fundamental building block of concurrent programming. Its API is simple:

  • Lock: Acquire exclusive access. If another thread holds the lock, the caller blocks until it’s released.
  • Unlock: Release exclusive access, allowing another thread to acquire the lock.

The toilet lock metaphor is famous among CS educators. A restroom with one stall has a lock on the door. You go in, lock the door (mutex acquire). Anyone else who tries to enter finds the door locked and must wait (mutex contention). You leave, unlock the door (mutex release). The next person enters. One person at a time, guaranteed.

But mutexes are just one flavor of synchronization:

  • Binary semaphore: Essentially a mutex, but without the ownership constraint — any thread can signal (V), not just the one that waited (P).
  • Counting semaphore: Allows up to N threads to access a resource concurrently. Think of a parking lot with N spaces.
  • Spinlock: A mutex that busy-waits in a tight loop instead of blocking. Useful for very short critical sections on multi-core systems.
  • Read-write lock: Allows multiple concurrent readers but exclusive access for writers. Optimizes for read-heavy workloads.
  • Mutex vs semaphore confusion became legendary on operating systems exams. The canonical rule: use a mutex for mutual exclusion, use a semaphore for signaling.

Did You Know?

The term “mutex” is so concise that it has spawned backronyms: “MUtual EXclusion” is the original, but some textbooks expand it as “mutually exclusive lock.” The OS X kernel is called XNU (X is Not Unix), and its locking subsystem includes mutexes, spinlocks, read-write locks, and lck_mtx.

In the Go programming language, mutexes are explicit (sync.Mutex), but the language also promotes the channel-based “do not communicate by sharing memory; instead, share memory by communicating” philosophy. Yet even Go acknowledges that sometimes you just need a mutex.

In Rust, the Mutex<T> type provides interior mutability — it wraps a value and guarantees that only one thread can mutate it at a time. Rust’s ownership system ensures you can’t even access the wrapped value without holding the lock, eliminating an entire class of race conditions at compile time.

The portmanteau “mutex” is so natural that it’s been translated into other languages. In French, it’s “mutex” (same spelling). In German, “Mutex” (capitalized as a noun). In Japanese, ミューテックス (myūtekkusu). Mutual exclusion is universal.

FAQ

What is deadlock?
Deadlock occurs when two or more threads each hold a mutex that the other needs. Thread A holds mutex X and waits for mutex Y. Thread B holds mutex Y and waits for mutex X. Neither can proceed. The term comes from the railroad “dead lock” — two trains facing each other on the same track.
Is a mutex the same as a lock?
In most practical contexts, yes. A mutex is a type of lock. But “lock” is the general concept (any mechanism that restricts access), while “mutex” specifically implements mutual exclusion. Other locks include semaphores, read-write locks, and distributed locks.

Related Etymologies

Why Is It Called 'Race Condition'?

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro