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?

[1563 byte] By [rhatca] at [2007-10-1 7:35:51]
# 1

I'd think you should be posting in the forum for the Solaris 10 os, not a Java forum. Maybe someone in the Java Native Methods forum would have the necessary Solaris 10 expertise, also.

If you do post elsewhere, either close this out with a final post or put a reference(s) to any other posts and say where you want replies posted, so replies aren't needlessly duplicated.

ChuckBinga at 2007-7-9 20:08:27 > top of Java-index,Administration Tools,Sun Connection...
# 2
Per Chuck's suggestion I re-posted this on the Native Methods forum. If anybody has any ideas please respond there. Native Methods seemed more appropriate than a pure Solaris 10 os forum since the problem only exists when the JNI is involved. Sorry to bug you guys with this one.
rhatca at 2007-7-9 20:08:27 > top of Java-index,Administration Tools,Sun Connection...