mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
- A worker writes the completion wake byte only when the pipe has none. The loop reads it, with the queue lock held, when it takes the last waiting completion. The pipe holds a byte exactly while completions wait, so a burst of completions costs one write and one read instead of one write per completion and a read loop per dispatch. - The fs pool's threads keep SIGPIPE and SIGXFSZ blocked for their lifetime. scr_fs_write_once checks once per thread whether both are blocked; on such a thread a write makes no signal-mask calls, and a write that fails with EPIPE or EFBIG consumes the signal it raised. Other threads keep the per-write guard. fs-write-sync.test.ts covers EPIPE and EFBIG from write streams, whose writes run on the pool's threads, and matches Node's errors.