3 ms·
> You wouldn't have true parallelism then, would you? So if you have something, for whatever reason, blocking further processing, the entire computer would loc
by paulmd 7y ago
> You wouldn't have true parallelism then, would you? So if you have something, for whatever reason, blocking further processing, the entire computer would lock up
That doesn't occur because the OS scheduler will eventually pre-empt your thread and swap to another task. You don't really have control over that. All modern OSs use pre-emptive multitasking and there's not a ton you can do to prevent it.
(read: anything in the last 30 years, last cooperative multitasking I remember was MacOS Classic (probably like OS7 or so.)
Single-core processors were the norm up until 15 years ago, and people routinely ran more than one process on them. Yes, we ran Discord (we called it Roger Wilco or Teamspeak back then) and played music in the background too, without 4 dedicated cores for the background tasks.
Yes, in the abstract it would be preferable to have a 64 GHz processor instead of 16 4 GHz processors, because then you can have all that speed devoted to a single task. Context switching is not that expensive (particularly if you have hyperthreads/SMT to soak up the wasted cycles). The physics of transistors make that impossible, but we absolutely would not do any of this multithreading crap if we didn't have to. Single-threaded code is easier to write and usually faster (in terms of less total cycles - multithreaded programs waste extra cycles on synchronization, overhead, spinning for locks, etc that single-threaded programs don't have to).
- theandrewbailey 7y ago> (read: anything in the last 30 years, last cooperative multitasking I remember was MacOS Classic (probably like OS7 or so.) I remember reading about that a while ago. Wasn't everything up to and including Mac OS 9 cooperatively multitasked?
- paulmd 7y agoLooks like it was cooperative until OSX actually. I just remembered that it was a loooooong time compared to other desktop OSs. > With the release of System 7, the MultiFinder extension was integrated with the operating system, and it remains so in Mac OS 8 and Mac OS 9. However, the integration into the OS does nothing to fix MultiFinder's inherent idiosyncrasies and disadvantages.[11] These problems were not overcome in the mainstream Macintosh operating system until the MultiFinder model was abandoned with the move to a modern preemptive multitasking Unix-based OS in Mac OS X. https://en.wikipedia.org/wiki/MultiFinder https://en.wikipedia.org/wiki/MultiFinder
- jacquesm 7y agoPlenty of embedded systems still use cooperative multitasking.