3 ms·
Maybe a noob observation, but can anyone explain why the Lock Coarsening example is valid? Seems to me that locks on A with a lock on B in between is not equiva
by karankamath 10y ago
Maybe a noob observation, but can anyone explain why the Lock Coarsening example is valid? Seems to me that locks on A with a lock on B in between is not equivalent to 2 locks on A and then one on B... Unless the programmer made a cognitive error the cases seem incomparable, unlike the other examples.
- taspeotis 10y ago"Seems to me that locks on A with a lock on B in between is not equivalent to 2 locks on A and then one on B" You're looking at: public void canNotBeMerged() The locks can't be merged.
- karankamath 10y agoYeah, but the semantics there refer to merged by an optimization? What's the point of having incomparable examples?
- Alphasite_ 10y agoJust to demonstrate an example of invalid code?