2026-03-09 19:18 UTC
Replies (2)
-
@Dianora@ottawa.place 2026-03-09 19:24
@ohmu@social.seattle.wa.us Several ways it can be done. Cooperative multitasking means each task does its own thing then starts the next task. Cooperates. Of course if a task hogs or infinite loops that's a problem. Nevertheless with a WD timer it can be done. Another way is a single task that gets interrupted to do simple I/O tasks. What you are describing is time slice and is nice for timesharing applications but not so much real time. Really I've simplified but it's all online if you are curious. I'm too lazy to get up to look at my textbooks. ;) DST took it out of me. (hate it!)
-
@dj3ei@mastodon.radio 2026-03-11 09:58
I'm familiar with the term "event loop". That architecture is common: JavaScript uses it, as does the nginx web server, for just two examples that come to my mind immediately. In event loop architecture, things happen either triggered by a clock or by some outside stimulus (often: IO available). There is an OS call named "select" that can be used as the central hub of an event loop. I've myself coded event loops on two occasions in the 1990s; one was based on that. Was fun. @ohmu@social.seattle.wa.us @Dianora@ottawa.place