Why Full Preemption?
(Slight Return)
Q1: Why are multitasking libraries and operating systems difficult to use and bloated?
A: Because they use full preemption.
Q2: Why do multitasking libraries and operating systems use full preemption?
A: That is how multiple threads can be simulated on a single processor.
Q3: Why do we simulate multiple threads on a single processor?
A: Processors are expensive, so we can only afford to use one processor.
Q4: Why are processors expensive?
A: Processors used to be expensive, but they are inexpensive now.
Q5: Why don't we use multiple processors, one for each thread?
A: Because that is the way we always did it, starting in the 1960s, when processors were expensive.
Conclusion
Use multiple processors. We no longer need to simulate multiple threads on a single processor. If we must simulate multiple threads on a single processor, we must not simulate scenarios, like memory sharing, that are not a natural way to use multiple processors. That just invites accidental complexity.
Acknowledgement
5 Whys approach suggested by Daniel Pink in Masterclass.
[This article was previously published on my old blog].
See Also
Email: ptcomputingsimplicity@gmail.com
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: guitarvydas.github.io
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/65YZUh6Jpq
Leanpub: [WIP] https://leanpub.com/u/paul-tarvydas
Gumroad: tarvydas.gumroad.com
Twitter: @paul_tarvydas
Substack: paultarvydas.substack.com

