B
Bryan
I'm trying to obtain per-thread timing information for my running
application. For example, I'd like to know the number of milliseconds
of CPU time thread X has been allocated so far.
System.currentTimeMillis gives me an approximation of this if I
serialize my thread activation, but it does not take into account
competition from other processes, blocks for I/O, etc.
The method that seems to be suggested most frequently is to use
JVMPI's GetCurrentThreadCpuTime from a chunk of native code. Under
Linux (kernel 2.4.20-18.9) and java 1.4.1 I do seem to get numbers
back (previous posters had reported only 0's being returned), however
the values do not seem to be thread-specific. All threads seem to be
sharing the same timer data. Has anyone used this successfully under
Linx?
Are there any other suggestions for obtaining high-resolution
per-thread timing information in Java under Linux?
Thanks.
application. For example, I'd like to know the number of milliseconds
of CPU time thread X has been allocated so far.
System.currentTimeMillis gives me an approximation of this if I
serialize my thread activation, but it does not take into account
competition from other processes, blocks for I/O, etc.
The method that seems to be suggested most frequently is to use
JVMPI's GetCurrentThreadCpuTime from a chunk of native code. Under
Linux (kernel 2.4.20-18.9) and java 1.4.1 I do seem to get numbers
back (previous posters had reported only 0's being returned), however
the values do not seem to be thread-specific. All threads seem to be
sharing the same timer data. Has anyone used this successfully under
Linx?
Are there any other suggestions for obtaining high-resolution
per-thread timing information in Java under Linux?
Thanks.