[concurrency-interest] StampedLock: A possible SequenceLock replacement

Doug Lea dl at cs.oswego.edu
Tue Jun 26 07:58:58 EDT 2012

> It seems to me that problems 1 and 2 are essentially orthogonal, and are
> addressed by separable parts of the solution, right?  Problem 2
> essentially requires something like a LoadLoad fence in the implementation
> of a validate()-like primitive, which, as Doug points out, makes it
> unimplementable in pure Java, and hard to explain in terms of the Java
> memory model.  But does it have much to do with the interface change,
> except that the interface change highlights the weird usage model?

This does require introduction of method validate(). In SequenceLock,
we allowed users to get the sequence and compare directly, which
didn't provide us anywhere to place the fencing needed upon the
validation check.


More information about the Concurrency-interest mailing list