Essentially, this is:
- A rudimentary preemptive RTOS
- Using an unmodified NES emulator (FCEUX) as the CPU
- "Unmodified" depending on how you define terms
- With emulator save states as the thread contexts- With support for (very basic) mutexes, interrupt masking, and condition variables
- Demonstrated using Super Mario Bros. 1-1 with sections of the map dedicated to various synchronization primitives
There are many simplifications and shortcuts taken (doesn't even have task priorities), and it doesn't map 1:1 to true multithreading (e.g., emulator save states represent the state of the entire machine including RAM, whereas thread contexts represent a much more minimal slice), but I think it's A) pretty interesting and B) a unique visceral explanation of threads.
ignormies•1d ago
I took a real-time operating systems course in university as an elective. One of the hardest courses I took the whole four years, but also one of the most interesting. Had a great professor, who gave really demanding, but very instructive, project-based assignments.
I need to find a toy project to play around with this domain again.
notorious_pgb•1d ago
I'm curious how effective you feel this specific example might've been if it were delivered during your course. I suspect I've stumbled across a really helpful teaching tool, but having not gone to university, I don't actually know how this stuff is being taught :v
throwanem•1d ago
notorious_pgb•1d ago
It's the sickest possible outcome for me, so: worth a lot!