So far, I have listing the flaws of locks as an attempt to push you, my dear readers, out of this dead-end.
But so far, I have been avoiding the solution space, purposely. This post will end that!
I like immutability and message passing, therefore I suggest you look into retlang/jetlang (C#/java). Based on the actor model, it offers a nice API helping the implementation of scalable services. It has been around for a few years now, and it clearly provides value.
It turns out the framework I designed working here has similarities with it, but it uses a different approach, offering extra services without the obligation of the actor model.
I will share its design in future posts!