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
http://www.javaspecialists.eu Tel: +30 69 75 595 262