mutex.buzz · a lock on attention

One concept in the frame at a time.

A mutex lets one thread in and makes the rest wait. This one does that for attention: whatever holds the lock is the single thing the frame shows.

What a mutex is

A mutex, short for mutual exclusion, is a lock a program puts around something several threads might touch at once: a file, a counter, a printer. A thread acquires the lock before it touches the thing and releases it when it is done. If another thread already holds it, the newcomer waits. The code that runs while the lock is held is the critical section, and only one thread is ever inside it.

A semaphore can let several in at once; a mutex lets in exactly one, and only the one holding it can let go. One bee to a cell.

Here, the shared thing is attention. A hold is the critical section, a close is the release, and the line of anyone waiting is public.

Threads at a mutex: one inside the cell, the rest waiting their turn in line.
One inside, two waiting.

Waiting

Nobody is waiting. The folio rests in the frame.

/now/ · /now.json · framed on attention.productions

The lock's month A ring for the month, in three holds: A to the 13th, B to the 26th, C to the last day. One holder sits in the cell at a time. ABC one to a cell

A folio holds the lock this cycle.

A new detail of the holder every hour, and a new holder at each close.

  1. A 1st to the 13th Lined stage facade
  2. B 14th to the 26th Teal Stripes Vibes wash
  3. C 27th to the last day factshift cabinet

The closes, in your calendar: subscribe · closes.ics

The rule, in Spw

#>mutex_buzz
#:lock #!attention

^lock{hold, rest, wait}<attention>
=holders[one]{frame}
$clock[utc]{13th, 26th, last_day}
!hold{close ~> close}
.rest[folio]{A, B, C}
~wait[public]{queue}
%release{now ~> close}<days>
@attention.productions{frame}
&frame{holder, close, queue}

?["What holds the frame now?"]{
  ~#expect: `one holder, until its close`
  !probe{ "find the hold whose since is at or before now" }
}



lock.spw · read it on the canvas ↗ · take it apart on spw.quest ↗

Time anchor & prime seed

Nested prime intervals (13d · 3h · 97-step turn · 13m beat · 7s breath) stay coprime across the UTC day so every 13-minute beat yields a fresh deterministic seed for the resting folio.

Seed — p3 · p7 · p13 · p37 · p97

Use the lock