What does Concurrent Coupling and Blackboard Reuse conclude, in numbers, about “Exclusive-Create Locks: Conflict Rates, the Cost of Moving On, and Lost Updates”?
Answer: Chapter 3 simulates exclusive-create locks in memory: overwriting loses 0.907 of updates with sixteen writers, exclusive creation never lets two windows hold one number, and ordered requests or single holding rule out deadlock.
Scope of the numbers: Parameters are illustrative, data are synthetic, and every figure is generated by the book's programs; the book is not individual business advice and promises no speed-up. Chapter 1 shows where the peak comes from, near 6.78 windows under illustrative parameters.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.907
| A. 50 trials, 40 events per writer | ||||
| writers | events | lost (overwrite) | share | CAS retries/event |
| 2 | 4,000 | 1,740 | 0.435 | 0.527 |
| 4 | 8,000 | 5,516 | 0.690 | 1.267 |
| 8 | 16,000 | 13,274 | 0.830 | 2.382 |
| 16 | 32,000 | 29,030 | 0.907 | 3.924 |
| B. events lost under CAS and under append, all runs: 0 |
Show the full program
# Chapter 3. p32: lost updates under overwrite vs compare-and-swap vs append.
# N writers each record M = 40 progress events in one shared status.
# Overwrite: read the value, think for a while, write value + 1; any
# write in between is silently lost. CAS: write only if the value is
# unchanged since the read, else re-read and retry. Append: each event
# is its own entry at the end of a log, the count is the log length.
# Random interleaving in memory; the think time is 0 to 3 steps.
import random
M = 40
TRIALS = 50
def overwrite(n, rng):
val = 0
plan = {w: M for w in range(n)}
read = {w: None for w in range(n)}
wait = {w: 0 for w in range(n)}
act = list(range(n))
while act:
w = act[rng.randrange(len(act))]
if read[w] is None:
read[w] = val
wait[w] = rng.randrange(4)
elif wait[w] > 0:
wait[w] -= 1
else:
val = read[w] + 1
read[w] = None
plan[w] -= 1
if plan[w] == 0:
act.remove(w)
return val
def cas(n, rng):
val = retries = 0
plan = {w: M for w in range(n)}
read = {w: None for w in range(n)}
wait = {w: 0 for w in range(n)}
act = list(range(n))
while act:
w = act[rng.randrange(len(act))]
if read[w] is None:
read[w] = val
wait[w] = rng.randrange(4)
elif wait[w] > 0:
wait[w] -= 1
elif val != read[w]:
retries += 1
read[w] = None
else:
val += 1
read[w] = None
plan[w] -= 1
if plan[w] == 0:
act.remove(w)
return val, retries
def append(n, rng):
log = []
plan = {w: M for w in range(n)}
act = list(range(n))
while act:
w = act[rng.randrange(len(act))]
log.append((w, M - plan[w]))
plan[w] -= 1
if plan[w] == 0:
act.remove(w)
return len(log)
if __name__ == "__main__":
rng = random.Random(41132)
print("A. {} trials, {} events per writer".format(TRIALS, M))
print(" writers events lost (overwrite) share "
"CAS retries/event")
alost = 0
for n in (2, 4, 8, 16):
lost = rtot = 0
for _ in range(TRIALS):
lost += n * M - overwrite(n, rng)
v, r = cas(n, rng)
rtot += r
alost += n * M - v
alost += n * M - append(n, rng)
ev = n * M * TRIALS
print(" {:>7} {:>6,} {:>16,} {:>5.3f} {:>17.3f}"
.format(n, ev, lost, lost / ev, rtot / ev))
print("B. events lost under CAS and under append, all runs: {}"
.format(alost))Single source and citation
Fan, Y. (2026). Topological Coupling of Concurrent Multi-Core Operations: Lock-Free Blackboard Signalling and Cross-Node Emergent Gains (Version 1.0.0), Chapter 3: Exclusive-Create Locks: Conflict Rates, the Cost of Moving On, and Lost Updates. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-411 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026411,
author = {Fan, Yafu},
title = {Topological Coupling of Concurrent Multi-Core Operations: Lock-Free Blackboard Signalling and Cross-Node Emergent Gains},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Serial Fraction and Coherence Overhead: Why Throughput Has a Peak
- Chapter 2 · Fitting σ and κ from Throughput Records: Least Squares, Bootstrap Intervals and Design
- Chapter 4 · The Append-Only Blackboard: Lock-Free Reads, Hash De-duplication and the Cost of Subscribing
- Chapter 5 · Coupling Topology and Search: Isolation, Ring, Small World and Full Connection on NK Landscapes
- Chapter 6 · Emergence as Measurable Reuse: Hypergraph Incidence and the Net Gain of Coupling
- Chapter 7 · Eastern and Western Sources Examined: Sunzi on Division, the Analects on Harmony, Windowless Monads and Smith's Division of Labour
- Chapter 8 · Field Tools and Checker Specifications: the Concurrency Ledger, Four-Kit Clauses and a Pre-Registered Test