fix(v4.0.0): wire review round 1 -- tests for the wake-up order and for waking only on enough room; no overflow moving a message; sleep for impossible room answers at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-08 14:12:33 -04:00
co-authored by Claude Opus 5.5
parent d5cd64605d
commit 83694b18be
6 changed files with 68 additions and 6 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ void v4_fabric_wake(v4_fabric *f, unsigned id);
* Sleep (8) and sleep for room (9) are the two that wait: the node stays
* blocked, executing nothing, until a message has come to one of its wires
* since it last fetched which wires have one -- or, for 9, until its wire
* has the room. A message has "come" when a put or a move or a device put
* has the room (a wire that can never have the room answers 1 at once). A message has "come" when a put or a move or a device put
* put it on the back of a queue; fetching Have clears that for all of the
* node's wires.
*
+3
View File
@@ -30,6 +30,9 @@
#define V4_WIRE_HEADER 7u /* the words of a message that are not its text */
/* a wire must be able to hold the largest message there is: 1,024 characters */
typedef char v4_wire_holds_a_message[(V4_WIRE_CELLS >= 7 + 1024 / 4) ? 1 : -1];
typedef struct {
v4_cell cell[V4_WIRE_CELLS]; /* the messages, one after another, going round */
unsigned head; /* where the front message begins */