Message155770
| Author |
neologix |
| Recipients |
anacrolix, neologix, pitrou, tasslehoff, vstinner |
| Date |
2012年03月14日.17:02:42 |
| SpamBayes Score |
1.4531837e-10 |
| Marked as misclassified |
No |
| Message-id |
<CAH_1eM0HTF58m8oRN46iuAhZnQfznQzf5cY4y1Sjjqcvh4sjLA@mail.gmail.com> |
| In-reply-to |
<1331742382.43.0.2021956504.issue14222@psf.upfronthosting.co.za> |
| Content |
Random thoughts:
- as noted by Antoine, it probably affects a lot of code throughout
the standard library
- sem_timedwait() (used by lock.acquire() on POSIX) is affected (the
implementation using a condition variable could use
pthread_condattr_setclock(), see issue #12822)
- there's a side effect to that change: on Linux, when the system is
suspended, CLOCK_MONOTONIC stops: so on resume, you'd have to wait for
the complete timeout to expire, whereas with time.time() you'll break
out early
That being said, it's probably a good idea.
As for the patches, I don't really like the idea of having to use this
idiom everywhere:
try:
from time import monotonic as _time
_time()
except (ImportError, OSError):
from time import _time |
|