Andreas Wild
Jul 23, 2017 · 1 min read

Having recently converted a 7kloc C++ codebase from global lock to message-passing, I strongly suggest considering dropping explicit locks entirely for messages. I came away with the impression that it was less work than changing lock granularity, since I could build the new functionality on the side and plug it in gradually. And the end result is cleaner since multi-threaded access is more clearly marked and isolated, the same kind of advantage as you get from the IO monad in Haskell. You may find more here (https://github.com/andreas-gone-wild/snackis/tree/master/src/snackis/db) if you’re interested, specifically in proc/write_loop/change_loop.

    Andreas Wild

    Written by