This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]