Program performance is always a concern, even in this era of high-performance hardware. This article, the first in a two-part series, guides you around the many pitfalls associated with benchmarking Java code. Part 2 covers the statistics of benchmarking and offers a framework for performing Java benchmarking. Because almost all new languages are virtual machine-based, the general principles the article describes have broad significance for the programming community at large.
I recently diagnosed the root cause of a concurrency bug, CR6822370,
and thought it sufficiently interesting to share the details. (CR 6822370 actually represents a
cluster of bugs that are now thought to be related by a common underlying issue).
Briefly, we have a lost wakeup bug in the native C++ Parker::park() platform-specific
infrastructure code that implements java.util.concurrent.LockSupport.park().
The lost wakeup arises from a race that itself arises because of architectural
reordering that in turn occurs because of missing memory barrier instructions.
The lost wakeup may manifest as various 'hangs' or instances of progress failure.
C. Häubl, C. Wimmer, and H. Mössenböck. Computer Languages, Systems & Structures, 39 (4):
123 - 141(2013)Special issue on the Programming Languages track at the 27th \ACM\ Symposium on Applied Computing.
T. Cutsem, S. Mostinckx, and W. Meuter. Computer Languages, Systems & Structures, 35 (1):
80 - 98(2009)ESUG 2007 International Conference on Dynamic Languages (ESUG/ICDL 2007).