This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/1256] New: Thread/process-specific CPU-time clock not implemented correctly?
- From: "myself at rojer dot pp dot ru" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 28 Aug 2005 01:04:53 -0000
- Subject: [Bug nptl/1256] New: Thread/process-specific CPU-time clock not implemented correctly?
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
it seems that CLOCK_THREAD_CPUTIME_ID clock returns wall-clock time since thread
was started instead of CPU-time used by thread.
reproducible: always
how to reproduce:
create a thread that runs the following loop:
for (;;) {
sleep(3);
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
printf("sleepy: %d, %d\n", end.tv_sec, end.tv_nsec);
}
this produces the following output:
sleepy: 2, 999741259
sleepy: 5, 999491833
sleepy: 8, 999247698
sleepy: 11, 999174019
...
expected result:
minor steps in cpu-time, since the thread is mostly sleeping.
CLOCK_PROCESS_CPUTIME_ID behaves exactly the same, measuring wall-clock time
instead of CPU-time.
--
Summary: Thread/process-specific CPU-time clock not implemented
correctly?
Product: glibc
Version: 2.3.4
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: myself at rojer dot pp dot ru
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1256
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.