Avi Ribchinsky, a friend and a college of mien, is transitioning
from C++ to the Java world. He had been playing with
Thread.sleep(), when he noticed that the sleep method might
oversleep more than ordered, and moreover, it could also under
sleep (see Fig 1). Coming from the C++ world, that surely caught
him surprised ;)  Fig 1.  Thread.sleep() under sleeping
Thread.sleep() under sleeping  How is sleep implemented in Java
anyway?  Avi came asking me if I knew anything about it, I was
wondering myself how such a common and important method could be
faking in the way shown above. Is it the OS? a Bug in the
specific JRE version used? Maybe the API doesn’t guarantee
milliseconds precision to begin with? Thinking about all of
these factors, we realized that we don’t really know how the JVM
implements the sleep method functionality, my best guess would
have been that the process registers itself in the OS for a wake
up call, and the OS wakes the process via a software interrupt.
OK, time to search the web.  The fo