3 ms·
The only areas I’ve ever seen that were truly super complicated were when synchronization is involved. It’s so hard to wrap my head around how a CPU reorders i
by dartos 2y ago
The only areas I’ve ever seen that were truly super complicated were when synchronization is involved.
It’s so hard to wrap my head around how a CPU reorders instructions and I need to think very slowly and very carefully whenever I work with synchronization.
Same with distributed systems. I implemented a toy version of raft forever ago, but just wrapping my head around it took a month, and I still think I don’t really grasp it.
Haven’t even looked into paxos yet.
- xxs 2y agoSync is easy. Concurrency is hard. Partly b/c as humans we can't multitask. CPU reordering instructions (and speculative execution) should be not be hard to understand. It tries to do as much work as it could before it has to stall due to lack of data
- dartos 2y agoSynchronization is like a sub-problem of working with concurrency. In this context they’re the same afaics CPU reordering isn’t hard to understand, itself, but building systems that depend on it is (like building a time sharing OS… very difficult) because it’s difficult to reason about. The implications of it are hard to understand because, as you say, we’re not naturally apt at multitasking