3 ms·
> Multithreading in C, however, is left as an exercise to the coder. Well, it is a systems implementation language, so it cannot, and should not, impose too ma
by usrbinbash 3y ago
> Multithreading in C, however, is left as an exercise to the coder.
Well, it is a systems implementation language, so it cannot, and should not, impose too many guardrails.
And yes, sometimes systems implementations need to do things that even all the checks built into Rust would scream loudly about. Rust, which is also meant to implement system code with, acknowledges this duality, that's why the `unsafe` keyword exists.
And while the complexity of avoiding race conditions does exist, we have good solutions for it. One such solution is CSP. Passing state and synchronizing via messages is an incredibly natural and logical way to think about the structure of concurrent codebases.
- kaba0 3y agoRust is also a “system implementation” language.
- usrbinbash 3y agoYes? I said so in my above post? > Rust, which is also meant to implement system code with