You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jvm topreturn JVM thread information.
We also need OS level top to display all OS thread
Information can includes:
ID - thread id
PR - thread prio
S - status,
%CPU
%MEM
TIME+
COMMAND - description
thread->id() is a numeric id of the thread. The comment in sched.hh suggests that it is a long int "guaranteed unique over system lifetime" but this is not correct any more. In fact it is an unsigned int (32-bit) which may wrap around, mimicking Linux process ids. The type and documentation of this function needs to change.
thread->priority() returns a thread's floating-point priority, where 1 is the default, 2 means the thread gets half the runtime as usual and 0.5 means the thread gets twice the runtime as usual. If for some reason you want the Posix-like exponential priority, you also have the getpriority() function.
A thread does have status (_detached_state->st) like running, queued, etc., but we do not have an API to get it. It will be easy to get.
For "%CPU" we need to define what it means (some sort of moving average?). One thing we can do is to expose the runtime the scheduler calculates for each thread (something like export_runtime) but this includes things (like the thread's priority) not normally part of %CPU. Or perhaps we need to a second counter, just for %CPU?
"%MEM" is meaningless for individual threads (threads share their memory).
For "TIME" we have sched::thread::thread_clock (needs to be documented...), and the normal Posix API clock_gettime(CLOCK_THREAD_CPUTIME_ID).
The closest thing we have to "COMMAND" is thread->name().
jvm top
return JVM thread information.We also need OS level top to display all OS thread
Information can includes:
ID - thread id
PR - thread prio
S - status,
%CPU
%MEM
TIME+
COMMAND - description
This is a side affect of fixing #23
The text was updated successfully, but these errors were encountered: