[concurrency-interest] Concurrency Puzzle

Dr Heinz M. Kabutz heinz at javaspecialists.eu
Thu Sep 29 15:54:58 EDT 2016

Hi everyone,

I've written a newsletter with a little concurrency puzzle that you 
might find amusing to try.  It is not difficult to solve, but please 
don't post your solution for now.  The code is very obviously broken, 
but it fails a bit too predictably.  Enough said ...


Once you've found the reason why it fails so consistently, the next step 
is to fix the code using Java 8 StampedLock.

This is just a thought exercise, so please don't go putting this class 
into your code base :-)


Dr Heinz M. Kabutz (PhD CompSci)
Author of "The Java(tm) Specialists' Newsletter"
Sun/Oracle Java Champion since 2005
JavaOne Rock Star Speaker 2012
Tel: +30 69 75 595 262
Skype: kabutz

More information about the Concurrency-interest mailing list