putting-the-you-in-cpu
putting-the-you-in-cpu copied to clipboard
Cooperative multitasking is still a thing
Hi,
Just noted in the end of Chapter 2 it reads “ For these reasons, the tech world switched to preemptive multitasking a long time ago and never looked back.” It looks like a bit of overstatement because concepts like coroutines and green threads are quite popular nowadays, and we even have quite popular languages built on top of that (Go with its goroutines). Appreciate language runtime-level cooperative multitasking is not the same as OS-level, but still worth mentioning I think.
Overall, a great write-up that I very much liked to read!
thanks!
The cooperative multitasking is still a thing, but on language level, not OS level. This is because on language level you don't have one of the problems - having malicious or badly designed program stealing all the resources. Your program still can be badly designed and have some thread steal all the CPU time allocated for the process for itself. But this is a bug in your program and you can fix it. Whereas if OS uses coop multitasking, bad design in somebody else's program can clog the whole system.