zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit
Date: Wed, 5 Oct 2016 08:03:59 +0200	[thread overview]
Message-ID: <CAKc7PVDk_RMaa07S6c648nGKMT=pLCv0UWj2UZL_aRdv6TsvJw@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVBQutmdVCFoZLDj2HP30Kf3_7yJXkLAiOx3kQRs1AgA7g@mail.gmail.com>

Or maybe this isn't problem at all. Any call not exactly at integer
SECONDS will be fixed to be near integer SECONDS as early as at second
scheduled call. Then, any possible drift away from integer SECONDS
will be always quickly fixed to integer SECONDS when diff == 0 is
checked at time(NULL) value change. So it's constant pull toward
integer SECONDS, nothing to worry about.


On 5 October 2016 at 07:56, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
> On 3 October 2016 at 17:49, Bart Schaefer <schaefer@brasslantern.com> wrote:
>> On Oct 3, 12:00pm, Sebastian Gniazdowski wrote:
>> }
>> } It looks like calc_timeout handles diff < 0 and diff > 0 but not diff
>> } == 0?
>>
>> Indeed, try this:
>>
> ...
>> -           if (diff < 0) {
>> +           if (diff <= 0) {
>
> It now appeared to me what the intention of diff < 0 could be. If one
> schedules at integer SECONDS + float 0.1, then after 100 ms time(NULL)
> will return different value and diff will be 0. So sched +1 scheduled
> function will run after 100ms. However next call will run as expected,
> near 1 second. I think this can be as it is, however maybe others
> would rather see ZTM_FUNC being returned for diff=0, so that select()
> still doesn't block, but sched +1 function will be ran when diff=-1.
> So, it's a matter of "scheduled function will run not earlier than
> scheduled time, up to 1 second late" vs. "scheduled function will run
> not later than scheduled time, up to 1 second early", both an effect
> of limited resolution of time(NULL).
>
> Best regards,
> Sebastian Gniazdowski


  reply	other threads:[~2016-10-05  6:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02 19:00 Sebastian Gniazdowski
2016-10-02 19:02 ` Sebastian Gniazdowski
2016-10-02 23:21 ` Bart Schaefer
2016-10-03 10:00   ` Sebastian Gniazdowski
2016-10-03 10:18   ` Peter Stephenson
2016-10-03 11:55     ` Sebastian Gniazdowski
2016-10-03 15:49       ` Bart Schaefer
2016-10-03 16:43         ` Sebastian Gniazdowski
2016-10-03 18:11           ` Bart Schaefer
2016-10-05  5:56         ` Sebastian Gniazdowski
2016-10-05  6:03           ` Sebastian Gniazdowski [this message]
2016-10-03 15:20     ` Bart Schaefer
2016-10-03 16:07       ` Bart Schaefer
2016-10-03 16:33   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVDk_RMaa07S6c648nGKMT=pLCv0UWj2UZL_aRdv6TsvJw@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).