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
writerseventslost (overwrite)shareCAS retries/event
24,0001,7400.4350.527
48,0005,5160.6901.267
816,00013,2740.8302.382
1632,00029,0300.9073.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