What concurrency-friendly structures forbid
Which guarantees can no concurrent design give, and in what order should the escapes be tried?
What this group forbids
- Shared mutable state and linear scalability cannot coexist. The coherency term is quadratic, and no implementation removes it. Only designs that avoid sharing do.
- You cannot free memory in a lock-free structure without a reclamation protocol.
- You cannot bound tail latency with lock-freedom. Only wait-freedom does that.
- You cannot make readers free without either immutability or a grace period.
The escapes, in order of preference
| Escape | What it costs |
|---|---|
| Partition to a single writer | Partitionability; skew is the ceiling |
| Immutability | Space and a collector |
| Optimistic concurrency | Retries, at a rate of 1/(1 − ρ) |
| Coarse locking | Scalability; frequently the right answer for structures that are not hot |