fix: yield GIL in realtime idle wait — busy-wait starves co-resident threads

#2
by Joiin0392 - opened

The realtime loop's idle branch (<|silence|>, nothing pending) spins on
while True: continue, monopolizing the CPython GIL. Every other thread in
the process is starved for as long as the session idles — e.g. an in-process
ASR decode inflates from ~150ms to 40-80s.

Measured (one busy-spin thread + SenseVoice decode in the same process):
584ms -> 42.6s (73x). Replacing the bare continue with a 20ms sleep poll
restores 132-152ms; input-detection latency stays negligible.

Platform-neutral: GIL behavior is identical on CUDA deployments — any
co-process embedding (ASR, TTS, metrics) is affected the same way.

OpenMOSS org

already merged

CCCCyx changed pull request status to closed

Sign up or log in to comment