I was wondering about the accuracy to expect from
the Linux JDK port of Thread.sleep(long) and
Thread.sleep(long,int), as well as 
System.currentTimeMillis(). Linux system timer
resolution is (according to manpage) 10msecs.
The Threads book by Oaks/Wong states that
sleep(..) simply rounds up to OS resolution - but
if I do 10 or more repeated sleep(1) calls, I do
get less, not more delay. A sleep( 0L, 500000 )
gets ignored completely (as do hundreds of them).
And currentTimeMillis returns increments below a
10msec resolution. The HTML specs state nothing 
of relevance...

So, is only the measurement f***cked up, or is
sleep(..) unreliable, too?
 
As a side node, is any of the RealTime Linux 
projects of any relevance for pthreads and/or 
Java/JDK ports?

                                      b.



Reply via email to