tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Docs: ADR 0028, mailboxes under contention and memory per actor (issue #98)

Measured on 1 to 22 threads: the per-actor lock is never contended with
one sender per receiver (messages, parallel), but under fan-in (the new
tests/bench/fanin.lse, 64 senders to one actor) a third of acquisitions
find it taken, and 22 threads run 4.8 times slower than one. The
inbox_fanin example isolates the inbox: a lock costs 124 -> 197 ns per
message from 1 to 21 senders, BEAM's locked outer queue as much from 16,
a lock-free MPSC stays at 60-70 ns. An idle actor (tests/bench/idle.lse,
100k actors) takes about 9.5 KiB, nearly half of it page tables: its
64 MiB stack reservation, not its mailbox.

Proposed: keep the lock for links, monitors and exits; replace the
mailbox's lock by a lock-free inbox (CAF's design: one atomic word, a
LIFO pushed with a CAS, with empty/closed/owner-waiting tags) drained
into the owner-private tag map; and make memory per actor its own work,
with a budget of 2 KiB. Researched: BEAM (the queue split and why, OTP
25's buffers, the atomic process state), Pony, CAF, Akka, Tokio, Go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 21cdf29e119cc6b0a2a5ca79f6528b896b89a718

Parents e6aeb20

7 fichiers modifiés, 304 ajouts, 1 suppressions