by limoce · 5y ago · 0 comments
Supposing you are going to write nontrivial concurrent programs like toy Raft, I believe that looking through RPC logs will be the most painful thing.
In contrast, on a single core, gdb is good enough. And there are also advanced examples like VMware's fault-tolerant VM and FundationDB's deterministic simulation. If we can debug concurrent programs without dirty tricks, just like single-threaded ones, I guess utilizing concurrency will be as handy as calling a function.
I wish there was something like Jepsen [1] broadly available to mainstream programming languages to do just that.
OpenMP with static scheduler and hardcoded count of threads?
OpenMP ain’t a silver bullet, but for many practically useful scenarios it’s indeed as simple as calling a function.
Can be tricky to debug or implement, but when I need that I normally use async-await in C#. The debugger in the IDE is multi-threaded, and does support these tasks.