Message235639
> Python/condvar.h and Python/thread_pthread.h should use the monotonic clock CLOCK_MONOTONIC
Oh, I forgot that Python/thread_pthread.h only uses pthread_cond_timedwait() if semaphores are emulated with mutexes+conditional variables.
On most platforms, PyThread_acquire_lock_timed() is implemented with sem_timedwait(). Problem: sem_timedwait() requires an absolute time using the CLOCK_REALTIME clock and the clock is not yet configurable on Linux :-(
See the feature request in the glibc: "Bug 14717 - Allow choice of clock source for calls to sem_timedwait() and pthread_mutex_timedwait()" opened in 2012:
https://sourceware.org/bugzilla/show_bug.cgi?id=14717
Note: QNX provides sem_timedwait_monotonic(). |
|
Date |
User |
Action |
Args |
2015-02-09 22:12:06 | vstinner | set | recipients:
+ vstinner |
2015-02-09 22:12:06 | vstinner | set | messageid: <1423519926.17.0.158732792797.issue23428@psf.upfronthosting.co.za> |
2015-02-09 22:12:06 | vstinner | link | issue23428 messages |
2015-02-09 22:12:05 | vstinner | create | |
|