liveBook · Manning

Concurrency

As explained in Think Distributed Systems

Concurrent execution is the overlapping execution of operations from multiple transactions without requiring one transaction to finish before another begins.

Concurrency is the overlapping execution of operations or transactions. It does not require one operation to finish before another begins, and it does not necessarily mean parallel execution. section 2.2.1

Use the happened-before relationship to reason about order. Events on one component follow their local order; sending a message happens before receiving it. Events are concurrent when neither happened before the other. section 2.2.1

Concurrency vs. parallelism
A group of black and white text

AI-generated content may be incorrect.

A compact comparison separates concurrency between events from parallelism between operations. section 2.2.1

A concurrent funds transfer

A transfer debits one account and credits another. If execution fails between those writes, the transfer is incomplete. Transactions hide this failure and preserve completeness; under concurrency, they also prevent concurrent effects from introducing inconsistent results. section 5.2.2 section 5.3.1

Correct concurrent execution is serializable: the combined effect must equal executing one transaction before the other, in either order. Temporary inconsistency during execution may be hidden while the transaction moves between consistent states. section 5.3.1

How Think Distributed Systems covers it

How deep it goes
Defines causal ordering and serializability, then illustrates failure and temporary inconsistency without detailing implementation mechanisms.
Examples
Uses message events, a funds transfer, partial writes, and equivalent serial transaction orders.
What you can do after
Evaluate concurrent executions by checking causal order, consistency preservation, and equivalence to a serial transaction order.
How it connects
Connects happened-before relationships, parallelism, transactions, consistency, failure, and serializability.

Also explained in

Compare how 23 books explain concurrency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Think Distributed Systems. The section links point to the parts of the book it draws on.