ELSEIF
Your brief EB
581 stories from 179 feeds 1079 clusters Refreshed 5 minutes ago next pull 23:11

TECH Signal 592 2 feeds carried it

Solaris introduced turnstiles to reduce mutex overhead and prevent priority inversion in blocking locks

Illustration only Photo by Sonia Dauer on Unsplash

Turnstiles let Solaris keep mutexes small while propagating priority through lock chains to avoid unbounded priority inversion.

WHY IT MATTERS

By solving mutex bloat and priority inversion, turnstiles made fine-grained locking practical, which benefits high-concurrency software. The mechanism has been adopted in other kernels and runtimes, so engineers encounter it even when not using Solaris directly.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

Turnstiles were created in Solaris to address the two problems of large mutex structures and priority inversion with blocking locks.

02

They store lock ownership, wait-queue information, and the state needed to block and wake threads in a separate turnstile object, leaving the mutex itself only a few bytes.

03

Turnstiles enable multi-hop priority inheritance by linking the turnstiles of nested locks so that a high-priority thread’s priority can propagate through the entire owner chain.

THE READ

What the cluster adds up to.

ORIGINAL ANALYSIS

Solaris engineers found that traditional blocking mutexes required a significant amount of metadata to track ownership, waiting threads, and the state needed for blocking and waking. This metadata made each lock expensive, which conflicted with the goal of fine-grained locking where many locks protect small pieces of state. At the same time, blocking locks did not disable preemption, opening the door to priority inversion when a low-priority thread held a lock needed by a high-priority thread. Turnstiles were introduced to solve both the size and the inversion problems.

A turnstile is a separate kernel object that holds the lock’s owner, the list of threads waiting for it, and the coordination state needed to block and wake those threads. The mutex itself is reduced to a small flag or pointer that references the turnstile, so adding another lock costs only a few bytes. When a thread blocks on a mutex, it is attached to the corresponding turnstile; if another thread with higher priority later blocks on the same mutex, the turnstile can raise the priority of the owner thread. By chaining turnstiles together, the system can propagate a priority boost through multiple nested locks, achieving multi-hop priority inheritance.

Because the mutex is now tiny, developers can afford to use many more locks, enabling finer granularity without paying a large memory penalty. This reduces contention and improves latency for high-priority tasks, giving Solaris the soft real-time behavior it aimed for. The idea proved useful beyond Solaris; variations of turnstiles appear in other UNIX-derived kernels, in web browsers’ scheduling subsystems, and in language runtimes that need efficient locking primitives. Thus engineers working on modern systems may encounter turnstile-based locking even when they never see Solaris code directly.

The turnstile approach adds indirection and requires the kernel to manage an extra data structure for each lock, which introduces a small amount of overhead and complexity. If lock chains become very deep, traversing the turnstile list to propagate priority can take longer, potentially limiting scalability in extreme cases. Moreover, the benefits depend on correct implementation of priority inheritance; if a system omits or misconfigures the turnstile mechanism, the priority inversion problem can reappear despite the mutex remaining small. Therefore, while turnstiles solve the original problems, they trade a bit of kernel complexity for the gains in lock size and priority safety.

Written by elseif from the cluster below · checked for specifics the sources never contained

THE CLUSTER

Same story, 2 feeds.

ORDERED BY FIRST SEEN
rdmsr.github.io via Lobsters Solaris Turnstiles Open ↗
OSnews Solaris’ turnstiles Open ↗