Interval Timing Issue On Solaris 10/Intel
Not sure this is the right forum for this, but I'll give it a shot. Please redirect me if you think there's a better forum. This is going to look like a "C" problem, but this really is a question about something going on in the interactions between the operating system, the JVM, and a piece of native code we have.
We have an interval timing facility that's implemented over a small set of platform-dependent native timing facilities. The *NIX "itimer" facility is used wherever it exists. On RedHat/Fedora we also implement a timer over the RTC device. On Windows we use a WaitableTimer.
On all platforms there's a Java class that bridges to an appropriate timing facility via the JNI, and to date this has worked great on all platforms except for Solaris 10 on Intel. By "worked great" I mean that the clock tics end up being almost exactly what we expect for a given configured Hz update rate. So... e.g. if we set up a timer for 50 Hz, then we actually get 50 Hz +/- some minor variation much less than 1 second.
On Solaris 10/Intel we set up a 50 Hz itimer in a plain-vanilla C app and we get ~50 Hz, but if we call the same C code from Java via the JNI we almost always end up with ~38Hz.
The amount of Java and native code involved is almost trivial, and the hardware is a smoking fast contemporary PC. We ran over the itimer facility on an old Sparc 5 box and it worked fine.
I've tried tweeking sundry esoteric -X and -XX JVM invocation options with no effect.
J2SDK 1.4.2-07 in all cases.
Thoughts?

