mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 07:31:06 -04:00
A signalled kernel event, or a thread that ended, woke every thread blocked in WaitSynchronization. Each woken thread takes a virtual core before it looks at its handles, asking a running thread of lower priority for its core when all are held, finds nothing signalled and blocks again. The audio renderer signals its event 200 times a second, so every thread that waits for a message, a timer or another thread's end did this 200 times a second at the cost of the threads that were working. A wait now records its handle list, and a signal wakes the waits that hold a handle of the signalled event or thread. NX2NAVI_SYNC_WAKE_ALL=1 (or ab) wakes them all as before, and the sched line counts the waits woken and left asleep. tests/sync_wake_check.py builds kernel.c with the rest of the runtime stubbed and checks the wakes, the timeouts, the cancel and that none of 4,000 signals to eight looping waiters is lost, in both modes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2.1 KiB
2.1 KiB