Rust concurrency patterns: A recipe for concurrent spaghetti

What makes multi-threaded processing models unreliable?(??????)

What I mean is that if a "processing model" is simply a list of sequential steps, executed in the same thread, it's in my opinion "more reliable" than a list of steps executed concurrently in several threads.

And so the way to build reliable "multi-threaded processing models", if you will, is in my opinion by combining several "single threaded processing models", executing concurrently and communicating in async ways, as opposed to going for actual "multi-threaded processing models".

My experience using Mutex for concurrency is that it causes bugs (eg:re-entrancy deadlocks) frequently enough that I naturally get pushed towards channels (or other push-pull style concurrency) in medium-sized projects anyway,leaving Mutex only for the things I know can be done atomically.

I'm glad to hear that is your approach. I still see shared-state concurrency being used "quite often", although I can't say I have done any serious polling across projects.

/r/rust Thread Parent Link - medium.com