atproto relay implementation in zig zlay.waow.tech
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

force Io.Threaded backend — fix SIGSEGV on startup

Evented (io_uring) futexWait/Wake dispatch through fiber-local
Thread.current() state. Frame pool workers are plain std.Thread —
they lack that state, so Io.Mutex contention segfaults immediately.

Threaded backend uses direct kernel futex syscalls that work from
any execution context. io.concurrent still spawns real OS threads
(same concurrency model as 0.15, just 0.16 APIs).

Evented can be revisited once frame workers either move to
io.concurrent or cross-boundary mutexes get a dedicated Threaded
sync_io.

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

+6 -3
+6 -3
src/main.zig
··· 47 47 pub const default_stack_size = 8 * 1024 * 1024; 48 48 49 49 // -- Io backend selection -- 50 - // Evented = Io.Uring (linux) | Io.Dispatch (macOS) | Io.Kqueue (BSD) | void 51 - // Falls back to Io.Threaded on platforms without fiber support. 52 - const Backend = if (Io.Evented != void) Io.Evented else Io.Threaded; 50 + // Evented backends (Io.Uring, Io.Dispatch, Io.Kqueue) use fiber-local state 51 + // for futex wait/wake. Plain std.Thread workers (frame pool) calling 52 + // Io.Mutex with an Evented io segfault because they lack that state. 53 + // Use Threaded until frame workers are migrated to io.concurrent or 54 + // cross-boundary mutexes get a dedicated Threaded sync_io. 55 + const Backend = Io.Threaded; 53 56 54 57 var backend: Backend = undefined; 55 58 var debug_threaded_io: Io.Threaded = undefined;