3 ms·
we used something similar when I was writing games in the early to mid 90's, but our yield function was simply called yield(). we were running on windows (3.11
by jerrysievert 6y ago
we used something similar when I was writing games in the early to mid 90's, but our yield function was simply called yield().
we were running on windows (3.11), macOS, and amiga (for tooling, the games didn't run on the amiga) with great success.
of course, we just used setjmp and longjmp, no assembly for portability (though there ended up being some assembly in one of the games, while macOS had good sound management, windows did not at the time and the audio mixing code ended up written in hand-rolled x86 assembly in order to perform well enough for the games to work on the hardware at the time).
- IncRnd 6y agoCool! I wrote one of these in the same timeframe to run coroutines on a dos extender in 32bit with flat addressing.
- Zardoz84 6y agoDIV Games Studio, a language and IDE to develop DOS games on late 90's, used coroutines on a similar fashion. Even it had priority levels, signals and hierarchies of coroutines. On DIV parlance, this coroutines where called "process", and yield() was called "frame()". I managed to remake this from scratch, using D fibers, for a pet/toy game engine that I'm writing.
- jerrysievert 6y agoI've always really liked the idea of cooperative multitasking: fewer gotchas, possibly safer memory access, and easier to control where/when a thread switches. of course in those days we had to deal with timing issues, couldn't let a cpu hog block another cpu hog :)