2 ms·
Message passing is not any easier or safer though. For every problem with shared memory concurrency you can draw a dual problem in message passing. See: https:/
by pkolaczk 3y ago
Message passing is not any easier or safer though. For every problem with shared memory concurrency you can draw a dual problem in message passing. See: https://songlh.github.io/paper/go-study.pdf https://songlh.github.io/paper/go-study.pdf
For me, single-threaded intra-task concurrency using async/await turned out to be safer and also easier to work with than either of the above mentioned concurrency models. Just a single loop with a top level select - everything is sequential and easy to reason about, also no need for any synchronization like locks or shared atomic pointers.