Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: time.monotonic() roll over Date: Fri, 05 Dec 2014 20:48:54 +0200 Organization: A noiseless patient Spider Lines: 30 Message-ID: <87wq66lyp5.fsf@elektro.pacujo.net> References: <54807cfd$0$2311$426a74cc@news.free.fr> <87vblr8lcw.fsf@elektro.pacujo.net> <87r3wf8jy8.fsf@elektro.pacujo.net> <87ppbzp9qq.fsf@elektro.pacujo.net> <87wq6788op.fsf@gmail.com> <87r3wfnih0.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="30447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1888AAgI7+ZNpZQevjnOsqv" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sJaJVd4ODgrm2v7Ejxiw2my51OQ= sha1:GSDtEbdVTgB7a4oz6ClqlZIHHPw= Xref: csiph.com comp.lang.python:82015 Ian Kelly : > On Thu, Dec 4, 2014 at 3:44 PM, Marko Rauhamaa wrote: >> So, what's the semantics of time.sleep(), select.select() et al wrt >> process or machine suspension? > > Rather than continue to speculate, I just tested this. The test, of course, can only have one useful result... > So it seems that it can go either way depending on the OS and perhaps the > mechanism of suspension. ... and you got it. If the semantics had coincided, the question would remain unresolved; it could just have been a coincidence. However, the variance in the results means the semantics are unspecified. I think programmer's would need facilities to determine and control the suspension behavior. All things being equal, *early* wakeup is preferable to late wakeup because the application can then check for a spurious wakeup and go back to sleep. The reverse situation would be painful to deal with. Marko