julia
84961e79 - runtime: Add an opt-in slotless poll window after targeted wakes

Commit
81 days ago
runtime: Add an opt-in slotless poll window after targeted wakes A thread woken by a targeted wake (jl_wakeup_thread — a sticky or pinned task was delivered specifically to it) may poll without holding a spinner slot until the sleep threshold elapses, instead of being force-parked by a saturated spinner cap. Threads that demonstrably receive directed work otherwise pay a futex round trip per task: in the parked-consumer channel pattern the hosting thread is denied a slot by persistent idle spinners and parks between every round. Polling uncounted is safe — the wake gate's lost-wakeup argument depends only on counted spinners' exit protocol, and the thread still parks through the standard publish + fence + re-check sequence — and it is demand-proportional: only an actual targeted wake grants a window. Off by default; Base.__init__ enables it when the workstealing scheduler is selected: the window helps schedulers with per-thread queues (an extra poller is nearly free; the workstealing backend's cross-pool pingpong drops 2x, to below the partr baseline) and hurts ones with shared queues (partr's heaps degrade ~50% under the extra idle polling, measured by same-build A/B). This commit was written with the assistance of generative AI (Claude). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Committer
Parents
Loading