OS with single process and global event loop

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
AndrewAPrice
Member
Member
Posts: 2300
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: OS with single process and global event loop

Post by AndrewAPrice »

If all you care about is throughput, then a global event loop would be pretty efficient. But, even languages such as Javascript eventually introduced threads ("Web Workers") for those long CPU heavy processes. You could do something similar, have your main event loop (which can support coroutines - yielding a coroutine throws it on the end of the event queue), and if you wanted to do something heavy such as video decoding, you could explicitly spawn a thread so this wouldn't hold up procesing.

You could even do something where you reset the system timer at the start of calling an event, and if uses up an entire time slice (say 100ms), you promote the event into a thread. But, there are caveats with this as you'd have to assume all code could potentially be executed in parallel.
My OS is Perception.
Post Reply