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

2014-04-26 Thread Shankar Unni
Shankar Unni added the comment: If you want to modify time.sleep(), you must be careful of the portability: Windows, Linux, but also Mac OS X, FreeBSD, Solaris, etc. Oh, I totally agree. What I'm trying to do is to define another autoconf flag (HAVE_CLOCK_NANOSLEEP), that does a feature

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

2014-04-18 Thread Shankar Unni
New submission from Shankar Unni: I know that an earlier request to use nanosleep() has been rejected as wontfix, but I'm filing this one for a different reason. Today, timemodule.c:floatsleep() calls select() on platforms that support it. On Linux, select() with a timeout has an unfortunate

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

2014-04-18 Thread Shankar Unni
Shankar Unni 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'll try to address both issues, or we could open a separate bug