Page 1 of 1

Cooperative multitasking

Posted: Sun May 02, 2021 8:34 am
by 0b1
My goal is to build a cooperative multitasking OS.

It will compile from byte code similar to JVM and CIL and the cooperation will be built-in.

My thinking is that taking it out of the hands of the programmer and putting it under the control of the OS will prevent or reduce the instabilities we saw back in the days of Windows 9x, which gave CMT a bad rep.

The plus side for me is a lot less task switching, stack operations, cache flushes, etc. at the hardware level, all of which is very expensive in an OS designed for virtualization - already running on top of an OS that has the CPUs doing a lot of that for its own purposes with extra for the purposes of virtualization.

Anyone see any flaws in my thinking, or have tried the same thing and run into the same problems as 9x

Re: Cooperative multitasking

Posted: Sun May 02, 2021 10:48 am
by Schol-R-LEA
You might want to look at the Oberon operating system, which worked in a similar way; for some reason, Dr. Wirth had decided that interrupts were an ugly hack, so he designed the language and OS to avoid them. The compiler for the Oberon language would automatically insert yields into the code, ensuring that the OS scheduler would frequently run even without any timer interrupts.

Re: Cooperative multitasking

Posted: Wed May 05, 2021 1:40 pm
by 0b1
Interesting link Schol-R-LEA - Thanks!

I feel the same way about interruptions. A lot of pushing and popping right when when I'm at my busiest.
Sounds like an Amazon delivery, while I in the middle of a complicated all-consuming problem.

It's good to know others think alike, even if it is is does fly in the face of current thinking. I do the same with Physics.