Opened on 02/28/20 at 16:32:39
Last modified on 04/03/20 at 17:43:47
#3891 new enhancement
Implement pthread_getcpuclockid()
Reported by: | Joel Sherrill | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | Indefinite |
Component: | posix | Version: | |
Severity: | normal | Keywords: | POSIX-Compliance |
Cc: | Blocked By: | ||
Blocking: |
Description (last modified by Joel Sherrill)
The pthread_getcpuclockid() method currently returns ENOSYS. It should be implemented. Since each thread has execution time statistics with it, this should just be a matter of figuring out how the clock id is specified for each thread.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getcpuclockid.html
The thread ID can be reused as the per thread cpu clock ID because it is distinct from any defined clock id.
Beyond adding the one method, the methods clock_gettime and clock_settime must also be modified to support this clock type. There may be other cases where per thread cpu clock id is used. A search for this capability in the POSIX standard will have to be done to ensure all use cases are covered.
This also will require writing test code and updating the POSIX Compliance Guide via the tracking spreadsheet.
Attachments (1)
Change History (3)
comment:1 Changed on 04/03/20 at 17:40:08 by Joel Sherrill
Description: | modified (diff) |
---|
Changed on 04/03/20 at 17:41:53 by Joel Sherrill
Attachment: | 0001-pthreadgetcpuclockid.c-Implement-pthread_getcpuclock.patch added |
---|
comment:2 Changed on 04/03/20 at 17:43:47 by Joel Sherrill
Description: | modified (diff) |
---|
Untested implementation of pthread_getcpuclockid() assuming thread ID is used as the per thread cpu clock id. Needs clock_gettime/clock_settime capabilities added and tests