4 ms·
StampedLocks have been talked about extensively at least on jsr-166 mailing list and they required adding load/load barrier in sun.misc.Unsafe. That was the pri
by xxs 12y ago
StampedLocks have been talked about extensively at least on jsr-166 mailing list and they required adding load/load barrier in sun.misc.Unsafe. That was the prime reason it needed Java 8, as previously it required a no-op CAS on the load path.
For most people StampedLock will remain quite a mystery as they are harder to use and the vact majority of Java developers doesn't actually write (or even use) low-level concurrency primitives.
- qwerta 12y agobut for many frameworks StampedLock is big progress.
- Someone 12y ago"StampedLocks have been talked about extensively at least on jsr-166 mailing list" Isn't that the jsr that designed StampedLock and decided to add it to Java? If so, I would hope it was talked about extensively, but I wouldn't see such talk as a counterexample.
- xxs 12y agoThat's the thing: people who are interested in them (StampedLocks) were already subscribed on the list. Like I've mentioned - outside there is close to no interest on low-level primitives, down to CPU memory barriers.
- thescrewdriver 12y agoIt's a nice performance improvement over ReadWriteLock as anyone who's ever tried it will know that RWL pretty slow.
- xxs 12y agoYes, RW-Locks have update (CAS) on the read path which prevents them from scaling.