dg_pthread_group_get_times(3T) SDK R4.11 dg_pthread_group_get_times(3T)
NAME
dgpthreadgroupgettimes - get CPU times for a thread group
SYNOPSIS
#include <pthread.h>
#include <timers.h>
int dgpthreadgroupgettimes(dgpthreadgroupt threadgroup,
struct timespec *usertimeptr,
struct timespec *systemtimeptr);
where:
threadgroup
Target thread group ID
usertimerptr
Pointer to the location to receive the accumulated user CPU
time
systemtimerptr
Pointer to the location to receive the accumulated system CPU
time
DESCRIPTION
This function returns the amount of user and system CPU time
accumulated by the thread group with thread group ID given by
threadgroup. The CPU time is the summation of all CPU time
accumulated by all of the thread group's past and present threads.
This call succeeds even if the thread group's resources have not been
freed. In other words, this call succeeds even if the thread group
has been marked as destroyed, as long as the thread group's resources
have not yet been cleaned up due to the existence of active or
undetached threads in the thread group.
DIAGNOSTICS
Return Value
If successful, dgpthreadgroupgettimes() returns 0, and saves the
accumulated CPU times in the locations pointed to by usertimeptr
and systemtimeptr. Otherwise, it returns -1 and sets errno.
Errors
For each of the following conditions, dgpthreadgroupgettimes()
returns -1 and sets errno to the corresponding value:
[ESRCH] The value specified by threadgroup does not refer to a
existing thread group.
SEE ALSO
dgpthreadgroupcreate(3T), dgpthreadgroupdestroy(3T),
dgpthreadgroupself(3T), dglwpinfo(2).
NOTES
For efficieny reasons, CPU time is not accumulated on a per-thread
basis, only on a thread-group basis. This allows for the fastest
possible thread-to-thread context switch within a thread group.
For a thread group dedicated to a globally scheduled thread, this
call returns the accumulated CPU time for the globally scheduled
thread because no other thread can be created in the thread group;
the same result is returned by a call to dg_lwp_info() for the
globally scheduled thread.
Licensed material--property of copyright holder(s)