Image missing.
A toy RTOS inside Super Mario Bros. using emulator save states

created: May 28, 2025, 8:15 p.m. | updated: May 29, 2025, 4:52 p.m.

What you just watched happens to be a multithreaded NES emulation, with Super Mario Bros. as the threads. Then I create three threads, and give them their respective save state to hold on to. We added threads to this emulator in the same way that we add threads to normal CPUs: we take clever advantage of a mechanism which allows us to A) save the current state of the machine and B) load it back up in the future if and when we choose. Whenever there is no thread that can be run (as would be the case in a deadlock, or if all threads are dead, or if all threads are asleep), the thread scheduler will halt the game and show an error message. Maybe this will be my DOOM thing: turning every video game into threads.

1 week, 4 days ago: Hacker News