3 ms·
> There is _no way out_. If you are writing concurrent apps, you have understand what's happening. Actually, there is a number of best practices that help you
by Hermel 13y ago
> There is _no way out_. If you are writing concurrent apps, you have understand what's happening.
Actually, there is a number of best practices that help you avoiding problems. For example, it helps to have a strict ordering of locks - i.e. everyone who locks on objects A and B, must do so first on object A. As a corollary, you should not call a callback or notify a listener while holding a lock - because you don't know what it will do. These two simple rules together already help a lot - even without understanding every possible state.