3 ms·
Sure, but if you're going to go that route, why not just say "the entire computing system at a whole is just a state machine, so what's the difference"? Thread
by lazulicurio 7y ago
Sure, but if you're going to go that route, why not just say "the entire computing system at a whole is just a state machine, so what's the difference"?
Threads provide a very privileged form of state machine that are tightly coupled with the underlying platform. This means you have to be thinking about things like cache coherency and context switches. Without careful use of other synchronization primitives (or stronger language guarantees[1]) it's easy to find yourself writing incorrect or less-than-performant[2] code.
[1] Like in Rust
[2] e.g. creating bottlenecks by blocking on access to a shared resource (Edit: perhaps a better way to word that would be "accidentally reintroducing blocking behavior by using synchronization primitives to access a resource")