diff options
Diffstat (limited to 'docs/design.md')
| -rw-r--r-- | docs/design.md | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/design.md b/docs/design.md index 702315b..e8805e5 100644 --- a/docs/design.md +++ b/docs/design.md @@ -101,7 +101,14 @@ round, oldest first, until it completes; a parked write keeps a copy of its data up to `park_data_max` bytes. Any other operation answering `again`, or a park with no free slot, fails with EAGAIN. Tflush answers a parked request's tag with EINTR before its Rflush and drops the slot; a flush of an -unknown tag is just Rflush. `hangup()` marks every open fid orphaned and +unknown tag is just Rflush. A clunk or remove of a fid does the same to +everything parked on it first, so no slot outlives its fid. Instead of +waiting to be retried, a backend may keep a parked request and answer it +itself (lib9p's kept Req): `ticket()` names the park by its slot and that +park's sequence number, `waiting()` says whether it still waits (not +flushed, clunked, hung up or out being retried), and `answer()` answers it +only then, so a tag a client reuses after a flush is never answered with +what was meant for the old one. `hangup()` marks every open fid orphaned and `next()` then yields the release each one owes before anything else, so a dropped connection still pays the backend; a Tversion does the same before negotiating. @@ -157,7 +164,14 @@ the connection's task with the engine unlocked and answers with engine over between `Conn.lock()` and `Conn.unlock()`, drives `next()`, `retry()` and `reply()` itself and calls `Conn.flush()` so the connection task sends what that produced (the editor answers on its own thread this -way). `opened` and `closed` bracket a slot's life; `Conn.user` is the +way). `Conn.hold()` answers `.again` and returns the park's ticket; +`Conn.waiting()` says whether it still waits, and `Conn.answerWith()` +answers it later from anywhere with what a producer makes, asking the +producer only while the park still waits and under the same lock, so an +answer that consumes (a record off a queue) is never spent on a flushed +request. The engine's sequence number counts on across the connections a +slot serves (`initIn` keeps it), so a ticket of one never names a park of +the next. `opened` and `closed` bracket a slot's life; `Conn.user` is the application's. Wake-up is explicit. Each connection has a flag word and an `Io.Event`; the |
