A Treatise In Six Chambers

concurrent.quest

"To run two things at once is to admit that time itself is a fiction we agreed to honour."

— from the marginalia of an unrecovered manuscript

Descend

Chamber II — The Thesis

Concurrency is not the absence of order; it is the discovery that order was always plural. Where the sequential mind sees a procession — one footstep after another upon a single path — the concurrent mind perceives a forest of paths, each traversed simultaneously by some other version of the walker.

The quest, then, is not to choose among them. The quest is to learn the grammar by which all paths may be spoken at once, without their voices collapsing into noise.

ยง see also: Lamport, 1978

Chamber III — The Stacks

Catalogued entries from the index of the lower archive. Each shelf bears its own quiet weight.

I.

On the Nature of Threads

A thread is not a thing but a remembrance. The processor remembers where it was, then forgets, then is reminded by an interrupt — and from this discipline of memory and forgetting, parallelism is born.

II.

The Mutex as Sacrament

There are doors which only one may pass through at once. The lock upon such a door is not a constraint but a covenant: by holding it, one promises that the next traveller shall find the room unaltered, save by the act of one's having been there.

III.

Of Deadlock and Its Avoidance

Two philosophers, hungry, each clutching one chopstick. Neither will surrender what they hold, and neither can eat. The lesson is older than computation: hunger shared is hunger doubled when no one will yield.

IV.

The Memory Model

What one core writes, another may not yet have read. The truth becomes plural before it becomes singular again. Between the writing and the reading lies a silence in which contradictions are permitted, briefly, to coexist.

V.

On Channels and Conveyance

Do not share memory by communicating; communicate by sharing memory. Or perhaps the inverse. The dictum has been transcribed both ways, and neither copy survives uncontested.

Chamber IV — The Concurrence

Two readings, simultaneous. Note where the threads converge.

/* thread A */

In the first hour, the scribe set down a sentence: "The city remembered itself." He did not yet know that, in another wing of the same library, his counterpart had begun a different sentence at the same instant.

The pen moved across the page with the steadiness of practice. Each word displaced an absence. Each absence had been, before its displacement, a possibility — a city, perhaps, or a forgetting.

Outside, the wind crossed the courtyard without remembering the courtyard. The candles in the cloister flickered in unison, then out of unison, then in unison again, by no governance but their own.

When the scribe paused, he set the quill in its rest and looked at what he had written. A sentence was a sequence: each word the cause of the next, each cause inherited.

And yet, beneath the sentence, the ink itself was many things at once — iron and oak and silence — bound only by their meeting in the well.

He resumed. The second sentence began before he had decided how it would end. This, he understood, was the nature of writing.

/* thread B */

In the same hour, in a chamber she had never visited, the other scribe wrote: "The forest forgot its names." Neither of them knew the other was writing. Both were certain of their solitude.

Her hand worked from the right margin inward, in the older fashion. The letters bloomed where her pen touched them. She paused often to listen, though there was nothing to hear.

A sequence, she had been taught, was the discipline of denying that anything else was happening. To write one word after another was to pretend that the world held still while the sentence formed itself.

It did not, of course. The world ran on without her. The window-glass cooled. A page in another room was being turned. The two scribes — without knowing it — lifted their pens at the same moment.

When she finished her line, she did not yet know whether it was the same line. There were words that could be said in two places without being repetitions, and words that could not.

The hour ended. The library remembered nothing, and forgot nothing, and continued.

Chamber V — The Archive

Loose folios, gathered without order. Read in any sequence; they were composed in all of them.

Petersen's Note

Two processes, each desiring entry to the same room, may agree by token: "I shall wait if you wish to go; you shall wait if I wish to go." The cordiality is asymmetric, yet correct.

// flag[i] = true

Fragment, Latin

"Cogitatio simul cogitata, simul scripta non est. Una manus, unum verbum."

Thought thought together is not written together. One hand, one word.

— from a marginal gloss, attributed

The Producer

while (true) {
  item = produce();
  buffer.put(item);
  // and somewhere, another
  // hand is taking it out
}

On Atomicity

To be atomic is not to be small but to be indivisible by the gaze of the other. The instant is an instant only because no observer was permitted between its halves.

Diagram — Critical Section

Only one process may inhabit the dotted region at a time.

Apocrypha

It is said that in some monasteries, the brothers transcribe two manuscripts at once, in adjacent rooms, each unaware of the other's progress. When both are complete, they are placed side by side. They are never identical. They are never wholly different.

The quest does not end. It only passes into another hand. Close the page, if you must; the other readers are still turning theirs.

concurrent.quest · · mmxxvi