3 ms·
> a single threaded cooperatively multitasked embedded OS in C/C++. It's good to remember that Windows 3.1 was essentially such a system. Apparently, for some
by amelius 8y ago
> a single threaded cooperatively multitasked embedded OS in C/C++.
It's good to remember that Windows 3.1 was essentially such a system. Apparently, for some reason the paradigm wasn't good enough.
- imtringued 8y agoIf it wasn't good enough why do NodeJS, Golang, Erlang, Ponylang and the commenter above still use it? The reason is OS level process scheduling has different requirements than task scheduling within a single application. The compromise is significantly lower efficiency in exchange for not letting rouge processes lock up the system. The poster child here is Erlang, which does a context switch on every function call because it has to switch to the receiving actor. Can your OS scheduler keep up with that?
- amelius 8y agoI wouldn't call Erlang's model "cooperative multitasking", since you can't make the assumption that there will be no context switch without giving up calling functions. In other words, it's cooperative, but under the enormous pressure that if you make a function call, you have to give up the thread of execution.
- com2kid 8y agoIf you control everything that runs on the system, it works just fine as an execution model. It works much less well when random apps are free to take ownership of the CPU and never release it. :)