RFR (M) CR 8023234: StampedLock serializes readers on writer unlock
Aleksey Shipilev
aleksey.shipilev at oracle.com
Tue Aug 20 14:55:47 UTC 2013
Thanks Martin!
New webrev:
http://cr.openjdk.java.net/~shade/8023234/webrev.01/
On 08/20/2013 03:06 AM, Martin Buchholz wrote:
> Thanks. Looks good.
>
> Style suggestions for the test:
>
> + while(!isDone && !isInterrupted()) {
> SPC after keywords.
Fixed.
> I think it's more readable to use CountDownLatch instead of
> CyclicBarrier for writerHasLock, because of asymmetric API.
> Doers call countDown(), waiters call await().
Nope, we need: a) *reusable* primitive, CDL is one-shot, unfortunately;
b) we need symmetric block, writer should also block on barrier until
both readers arrive; this makes test much more reliable.
-Aleksey.
More information about the core-libs-dev
mailing list