[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

Charles-François Natali report at bugs.python.org
Tue Aug 23 20:54:29 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> Using CLOCK_MONOTONIC is better than CLOCK_REALTIME (default) for GIL
> because settimeofday() may break the pthread_cond_timedwait().

Indeed.
A couple remarks:
- regular locks and conditions variables exposed by the threading module suffer from the same problem
- POSIX semaphores are also affected, but you can't select an alternative clock source
- actually, CLOCK_MONOTONIC is affected by NTP adjustements: while it's guaranteed not to go backward, its rate can be affected

Did you really encounter this problem, or is this just a theoretical concern?

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12822>
_______________________________________


More information about the Python-bugs-list mailing list