> patterns like RCU
RCU isn't mutable shared state! It's sharing immutable state! That's the whole paradigm.
https://en.wikipedia.org/wiki/Read-copy-update#Name_and_over...
There is state.
It is shared state.
It is mutable state.
There are readers, who can see the shared state.
There are writers, who copy it, update it and push it back so that the new state is visible to everyone else.
I have no idea what your definition of mutable shared state might be if that doesn't fit it.
This explains why massively parallel HPC codes are mostly minimal mutable state designs despite seemingly poor theoretical properties for parallelism. Real world performance and scalability is dictated by minimization of memory copies and maximization of cache disjointness.
But it's really an 'it depends' situation.
The fastest algorithms will smartly divide up the shared data being operated on in a way that avoids contention. For example, if working on a matrix, then dividing that matrix into tiles that are concurrently processed.
It's all flavors of the same thing. Lock contention is slow because sharing mutable state between cores is slow. It's all ~MOESI.
> The fastest algorithms will smartly divide up the shared data being operated on in a way that avoids contention. For example, if working on a matrix, then dividing that matrix into tiles that are concurrently processed.
Yes. Aka shared nothing, or read-only shared state.