liveBook · Manning

Lock-free

Lock-free is a concurrency progress guarantee under which at least one operation completes within a finite number of steps despite contention, without relying on mutual-exclusion locks.

How 3 Manning books explain it

C++ Concurrency in Action, Second Edition

A progress guarantee under which, when threads continue taking steps, at least one operation completes despite contention.

How it is used
Provides a progress criterion for concurrent data structures that avoid mutex-protected operations.
How deep it goes
Defines progress guarantees and explains compare/exchange retries, then exposes unresolved reclamation in an initial stack.
Examples
Contrasts an atomic-flag spin-lock mutex with a compare/exchange stack whose initial pop leaks nodes.
What you can do after
Evaluate/understand it by checking whether concurrent operations progress and spotting starvation, hidden locks, and unsafe stack-node deletion.

Read how C++ Concurrency in Action, Second Edition explains lock-free →

Modern C, Third Edition

The lock-free property indicates that operations on an atomic type do not require a hidden lock and are indivisible with respect to signal interruption.

How it is used
Supports indivisible operations on shared state in asynchronous signal handlers.
How deep it goes
Explains observable indivisibility and demonstrates a conditional counter, without detailing how the runtime enforces it.
Examples
Uses a conditionally compiled atomic signal counter and contrasts it with sig_atomic_t increments.
What you can do after
Evaluate signal-handler counter choices and recognize when the demonstrated counter falls back to a no-op.

Read how Modern C, Third Edition explains lock-free →

Latency

Lock-free synchronization is a concurrency technique that guarantees system-wide progress by ensuring that some thread completes an operation within a finite number of steps, without guaranteeing progress for every thread.

How it is used
Uses lock-free progress to reason about low-latency concurrent systems without requiring every thread to complete each operation.
How deep it goes
Defines system-wide finite progress and contrasts it with blocking and wait-free conditions, but does not detail an implementation algorithm.
Examples
Uses mutex waiting, long critical sections, deadlock, and competing lock acquisition to illustrate unpredictable blocking progress.
What you can do after
Evaluate concurrent designs by distinguishing system-wide lock-free progress from per-thread wait-free guarantees and blocking behavior.

Read how Latency explains lock-free →

Also covered in

What to know first

Related concepts

Questions about lock-free

What is lock-free?

Lock-free is a concurrency progress guarantee under which at least one operation completes within a finite number of steps despite contention, without relying on mutual-exclusion locks.

Which Manning books explain lock-free?

C++ Concurrency in Action, Second Edition, Modern C, Third Edition and Latency.

What should I know before learning lock-free?

Manning books that teach lock-free usually introduce deadlock and locking first.

What is the difference between lock-free and spinlock?

Lock-free is a concurrency progress guarantee under which at least one operation completes within a finite number of steps despite contention, without relying on mutual-exclusion locks. A spinlock is a mutual-exclusion synchronization primitive in which a waiting thread repeatedly checks or attempts to acquire the lock rather than blocking.

What kinds of lock-free are there?

Kinds of lock-free include optimistic concurrency control and atom.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.