summaryrefslogtreecommitdiff
path: root/runtime/session.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 09:32:39 -0300
committerGabriel Schneider <[email protected]>2026-11-20 11:35:27 -0300
commit6ba1f5be0a838d1fda81425300ed5aca90b1f1ab (patch)
treecd923f1b5394fcfb96b5f3e9a4fe37628b944dc8 /runtime/session.zig
parent35b2c0efc6c43ba44640f4432d98734000f8887a (diff)
downloadpardes-6ba1f5be0a838d1fda81425300ed5aca90b1f1ab.tar.gz
pardes-6ba1f5be0a838d1fda81425300ed5aca90b1f1ab.zip
kept: a session's daemon is asked whether it keeps it by the hello's answer, however late it comes, not by a 2 s clock: kept() (runtime/daemon.zig) waited at most 2000 one-millisecond sleeps for the reader thread to take the daemon's ok, and the reader starts only after the session loop's first pass, so an Adopt (dev/host_io.zig Adoptions.ask) or a Detach asked before it, or while a busy daemon had not answered, was refused 'no pardes daemon is keeping shells for this session' with the daemon up and listing the session (14 of 40 rounds at a load of 16-37, an Adopt right after the first frame); now kept() starts the reader itself if the first frame has not (daemon.notesTo, before the session's first step, says where its notes go; watch() takes no arguments) and waits on a futex for the reader's word (up, or gone at the link's end): 0 of 40 at the same load; test/daemon.py answer_late (plain mode and --relink): an Adopt asked while the daemon is stopped 3 s, refused after 2.1 s before (3 of 3), adopted after 3 s now; the upgrade case keeps its waits for the first frame and the listing, for its new-to-old run against a build without this; tui.zig's quit path no longer starts the reader before kept; after, pinned to one CPU: 0 of 40; the five together: tui core-test 859/1014, shell-test 1055/1058, pane-test 183/184, term-test 17/17, kitty-test 45/45, behaviour-test 275/275 and --replay, process-test 0 of 144 (cmdexit once, again alone), daemon.py in every mode, both soaks diverged 0 unequal 0, gui unit-test 1651/1655 (BaselineHarnessMismatch), the frame and perf gate against tree2 PASS
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/session.zig')
-rw-r--r--runtime/session.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/session.zig b/runtime/session.zig
index 5d7eff78..93b72deb 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -100,6 +100,7 @@ pub fn Loop(comptime Frontend: type) type {
l.host = try fe.open(&l);
defer fe.close(&l);
+ daemon.notesTo(l.fe, note);
defer l.peers.deinit();
// Before the core goes: each client sees its link end.
defer l.peers.dropAll(l.core);
@@ -159,7 +160,7 @@ pub fn Loop(comptime Frontend: type) type {
/// since the last one died told the shells' masters it held.
pub fn watch(l: *L) void {
if (daemon.relinked()) l.ptys.tellDaemon();
- daemon.watch(l.fe, note);
+ daemon.watch();
}
fn note(ctx: *anyopaque, n: daemon.Note) void {