Concurrent Programming in Java
© 1996-1999 Doug Lea

Errata for the third printing of the second edition

Corrections and Clarifications

Page 72
Add note:
This Fraction class can encounter integer overflow if the cross product of numerators or denominators exceeds 2^63. You can avoid most such problems in full versions of this class by prescaling.
(Cases of potential integer overflow problems in other code examples in the book are somehow mentioned in accompanying text, but this one got by without a disclaimer.)

Page 120
The variable framesPerSecond should be declared volatile, and the second paragraph should change "initialization checks" to "initialization checks for volatile variables"

Page 243
Change "This is acceptable..." to "This may be acceptable ...". And add note:
However, subsequent withdrawals may be penalized by such a missed update. To avoid the possibility of continually blocking out these savings-initiated transfers, they could use a time-based retry operating on a fair synchronization tool such as a FIFOSemaphore rather than use the illustrated exit without transfer when busy in method tryTransfer.

Thanks to Christopher Smith, Attila-Mihaly Balazs, and AG McDowell for pointing out problems.

Please send any questions or comments about this book to

Doug Lea
Last modified: Sun Oct 6 19:22:59 2002