tobogganSe connecter

louise

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

Runtime: a loom model of the mailbox; a killed actor no longer parks (issue #98)

The OTP state other actors change under an actor's lock (Proc: mailbox,
wait, links, monitors, run state) moves from sched.rs to otp.rs, generic
in its values and fiber. Each step of the protocol is one method there:
deliver, receive, time_out, waits_until, exit, stop, take_wake, release.
The scheduler, process.rs and the loom models call the same code.

Three loom models (RUSTFLAGS="--cfg loom" ... --lib otp), added to ci.sh:
- sends_race_a_receive: two messages on two tags race with a receive on
  one; it gets its message once, the other stays and wakes nobody;
- a_timeout_races_a_send: the receive returns the message or None, never
  both, and an unreturned message stays in the mailbox;
- a_kill_races_a_send_and_a_receive: the message is received, refused,
  left in the mailbox or as the wake value, exactly once; a waiting actor
  is queued once, to unwind.

The third found a bug: an actor killed while it ran (its wait was Ready,
so the kill woke nobody) that then received without a timeout, or waited
for a socket, parked for good. Messages to it were refused, so only
main's exit unwound it: its stack, mailbox and defers were held until
then. park_as now leaves an exited actor ready (except in a blocking
call, which runs to its end), so its thread queues it again and it
unwinds.

handoff.rs's wake_while_running model, a hand-written copy of the
delivery protocol, is replaced by sends_race_a_receive.

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

olivier · il y a 1 mois · db4fbb13ac6d54429d8940614e21b3ff0e8f5318

Parents b6e4234

11 fichiers modifiés, 724 ajouts, 351 suppressions