mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Callbacks: A notify takes the thread out of its CB wait right away
On hardware, notifying a callback of a thread in a CB wait takes it out of the wait at once, even though the callback only runs when the thread would get the CPU. A semaphore signalled in between doesn't end the wait: the callback runs first, then the wait resumes and takes it (pspautotests threads/callbacks/combos). We left the thread on the wait list until the callback started, so the signal ended the wait and the callback didn't run. The notify now pauses the wait, as starting a callback used to. If the callbacks are canceled before the thread's turn comes, the wait just resumes (Thread savestate section version 7). threads/callbacks/combos goes in the to-do list: a callback returning to the thread that notified it still takes ~13us where hardware takes ~9, part of the context switch cost. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
fb9ac8397e
commit
a17a9eb147
3 files changed
+33
-2
Reference in new issue
Block a user