← Back to context

Comment by yjftsjthsd-h

5 years ago

> then restore the registers and longjmp back to the main game code which had been originally interrupted by the vertical blank interrupt.

So that's really like, half preemptive with the return side really being cooperative style?

Yes, exactly (and why I described it as limited).

The physics thread (with interleaved joystick read code on PC) did have to yield back to the main/graphics thread. That was no issue in our case; I've not thought deeply about it, but it seems like the method is likely extensible to do context switches among multiple [unaware/non-cooperating] threads.