Writing an OS in Rust: Async/Await
Is async&#x2F;await a good idea for an OS kernel, even a toy one? Cooperative multitasking tends to break down at scale, because the probability that all the &quot;threads&quot; you&#x27;re cooperating with are playing nice goes to zero as the number of threads increases. An OS will tend to have a concentrated number of the pathological cases in it as it deals with hardware and all the other hardest timing &amp; concurrency problems.<p>It&#x27;s a viable option for user-space programs because you can far more tightly characterize them and program them from top to bottom to work with that paradigm nice. Embedding islands of cooperative multitasking in a sea of pre-emptive multitasking seems to make a lot more sense than the other way around.<p>However, this post is a question, not a statement. If, for example, a Linux kernel developer posts &quot;nah, it&#x27;s no biggie, the Linux kernel is effectively structured the same&quot;, for instance, I would not quibble.