[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

STINNER Victor report at bugs.python.org
Sun Apr 27 01:45:47 CEST 2014


STINNER Victor added the comment:

"I'm working on a patch, but I noticed a similar issue in Condition.wait(), which also keeps re-evaluating the "remaining sleep time" based on the current kernel clock, with similar effects."

I see that Lock.acquire(timeout) uses the C function gettimeofday() to recompute the timeout if acquiring the lock was interrupted (C error "EINTR"). It would be better to use a monotonic clock here, but please open a new issue because it's unrelated to nanosleep().

Or did you another bug?

By the way, you didn't mention the Python version. Are you working on Python 2.7 or 3.5?

See also the PEP 418.

----------

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


More information about the Python-bugs-list mailing list