This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Implementation of pthread_cond_wait() with CLOCK_MONOTONIC
- From: Benedikt Spranger <b dot spranger at linutronix dot de>
- To: libc-help at sourceware dot org
- Date: Wed, 4 Feb 2009 20:51:34 +0100
- Subject: Implementation of pthread_cond_wait() with CLOCK_MONOTONIC
Hi,
while looking for a strange behavior of an application, I tracked down
the implementation of pthread_cond_wait(). The application sets the
clocksource via pthread_condattr_setclock() to CLOCK_MONOTONIC. The
implementation of pthread_cond_wait() calls the clock_gettime syscall
(with CLOCK_MONOTONIC) and calculates a delta. Everything fine here.
But now lll_futex_timed_wait() is called. As I see, this results in a
futex syscall. Maybe I am wrong, but as I see in the futex kernel
syscall implementation, this syscall relies on CLOCK_REALTIME. Did I
oversee something or is the actual implementation of
pthread_cond_timedwait() broken and a application cannot avoid clock
screws here?
regards
Benedikt Spranger