Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82009

Re: time.monotonic() roll over

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'operator': 0.03; 'base.': 0.05; 'correct,': 0.09; 'expired': 0.09; 'part,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:skip:t 10': 0.09; 'missed': 0.12; 'interval.': 0.16; 'looping': 0.16; 'message-id:@4ax.com': 0.16; 'periods': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'bit': 0.19; 'input': 0.22; 'processor': 0.24; 'url:home': 0.24; '---': 0.24; "i've": 0.25; 'pending': 0.26; 'task': 0.26; 'header:X-Complaints-To:1': 0.27; 'dec': 0.30; 'relative': 0.30; '(which': 0.31; 'becoming': 0.31; 'clock': 0.31; 'disable': 0.31; 'expire': 0.31; 'once,': 0.31; 'languages': 0.32; 'regular': 0.32; 'worked': 0.33; 'fri,': 0.33; 'period': 0.33; "i'd": 0.34; 'common': 0.35; 'operations': 0.35; 'there': 0.35; '+0200,': 0.36; 'skip:> 10': 0.36; 'next': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'operating': 0.37; 'requirements': 0.37; 'list.': 0.37; 'being': 0.38; 'stopped': 0.38; 'to:addr:python-list': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'catch': 0.60; 'gone': 0.61; 'lost': 0.61; 'entire': 0.61; 'took': 0.61; 'more': 0.64; 'different': 0.65; 'account': 0.65; 'world': 0.66; 'prompt': 0.68; 'behavior': 0.77; 'ambiguous': 0.84; 'gap': 0.84; 'subject:over': 0.84; 'expires': 0.91; 'received:108': 0.93; 'serious': 0.97
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: time.monotonic() roll over
Date Fri, 05 Dec 2014 12:31:48 -0500
Organization IISS Elusive Unicorn
References <54807cfd$0$2311$426a74cc@news.free.fr> <87vblr8lcw.fsf@elektro.pacujo.net> <mailman.16564.1417709156.18130.python-list@python.org> <87r3wf8jy8.fsf@elektro.pacujo.net> <mailman.16566.1417710430.18130.python-list@python.org> <87ppbzp9qq.fsf@elektro.pacujo.net> <5480fea7$0$12992$c3e8da3$5496439d@news.astraweb.com> <87d27yoc1a.fsf@elektro.pacujo.net>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-108-68-179-216.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16630.1417800718.18130.python-list@python.org> (permalink)
Lines 49
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417800718 news.xs4all.nl 2916 [2001:888:2000:d::a6]:49604
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82009

Show key headers only | View raw


On Fri, 05 Dec 2014 08:17:53 +0200, Marko Rauhamaa <marko@pacujo.net>
declaimed the following:


>If a program spends long periods in an induced coma (which is becoming
>more and more common nowadays), the whole design of the program is under
>quite a bit of strain. What to do with time-based statistics collection?
>Should periodic operations catch up with the lost time by repeating in a
>tight loop for a zillion times? What to do with "impossible,"
>out-of-order event sequences?
>
	You do what the requirements for the system specify. If the
requirements don't state a behavior for this situation, the design of the
system is faulty and needs to be corrected.

	On my part, every system I've worked on with a "delay", "pause", or
"sleep" operation that takes a relative time as input ("pause" is otherwise
ambiguous -- some languages use it to put a prompt on a console and wait
for operator to resume) have always made the delay relative to the
processor time base. Suspending/blocking a task while the system is still
operating did mean that any pending delay likely expires immediately upon
the task being resumed/unblocked and put on the ready list.

	Now -- what to do in the case of the entire computer being hibernated
is a different matter; synchronizing the "tick" clock used by sleep with a
wall-clock/RTC to account for time spent in hibernation should immediately
expire pending sleeps (or, more correct, expire those that would have
expired if the system had not gone into hibernation).

	Your "time-based statistics collection"? If the time is based on
wall-clock time, and the system is put into hibernation, I'd expect sleeps
to be expired when coming out of hibernation, and one would have a gap in
the collected data time-stamps -- and no sudden looping to collect however
many "missed" intervals took place... The data would collect once, and then
set up for the next standard interval.

	If based upon processor clock tick, independent of wall-clock time, and
the processor clock does not tick during hibernation, then there are no
missed collection intervals from the view of the process. The process does
not know that the world stopped for some period of time.

	If the process needs to be regular with wall-clock time, and missed
intervals are a serious condition --- well; disable hibernation modes.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

time.monotonic() roll over "ast" <nomail@invalid.com> - 2014-12-04 16:25 +0100
  Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 17:50 +0200
    Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 09:05 -0700
      Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 18:21 +0200
        Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 03:27 +1100
          Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 20:09 +0200
            Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 05:29 +1100
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 20:44 +0200
                Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 07:02 +1100
            Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 12:29 -0700
            Re: time.monotonic() roll over Akira Li <4kir4.1i@gmail.com> - 2014-12-04 23:24 +0300
            Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 07:33 +1100
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 22:51 +0200
            Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 15:17 -0700
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 00:44 +0200
                Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-05 10:04 -0700
                Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 20:48 +0200
            Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 11:39 +1100
              Re: time.monotonic() roll over Dave Angel <davea@davea.name> - 2014-12-04 20:21 -0500
                Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 13:54 +1100
                Re: time.monotonic() roll over Dave Angel <davea@davea.name> - 2014-12-05 00:29 -0500
                Re: time.monotonic() roll over Lele Gaifax <lele@metapensiero.it> - 2014-12-05 08:56 +0100
                Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 21:09 +1100
                Re: time.monotonic() roll over Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-05 12:12 -0500
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 08:17 +0200
                Re: time.monotonic() roll over Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-05 12:31 -0500
              Re: time.monotonic() roll over Akira Li <4kir4.1i@gmail.com> - 2014-12-05 12:48 +0300
    Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 03:12 +1100
    Re: time.monotonic() roll over random832@fastmail.us - 2014-12-04 11:51 -0500
  Re: time.monotonic() roll over Nobody <nobody@nowhere.invalid> - 2014-12-05 00:54 +0000

csiph-web