From: dana <dana@dana.is>
To: Cedric Ware <cedric.ware__bml@normalesup.org>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] Enable sub-second timeout in zsystem flock
Date: Mon, 6 Jan 2020 21:48:30 -0600 [thread overview]
Message-ID: <F61E41A1-9EF2-4A45-96C7-E7AF516AC763@dana.is> (raw)
In-Reply-To: <20200106173030.eb2pg4rhhgysh35r@phare.normalesup.org>
On 6 Jan 2020, at 11:30, Cedric Ware <cedric.ware__bml@normalesup.org> wrote:
> Not quite pointless: in the last iteration of the retry loop, if the
> timeout is closer to the current time than the retry interval, zsleep()
> only waits until the timeout, then there's a last locking attempt, and
> only then the function fails.
Oh, i missed that, sorry. That doesn't seem so bad.
On 6 Jan 2020, at 11:30, Cedric Ware <cedric.ware__bml@normalesup.org> wrote:
> Also, I thought I'd reuse the same mnumber variable to parse
> the arguments of both -t and -i, but I can change that if it breaks the
> coding style.
It's fine afaik
On 6 Jan 2020, at 11:30, Cedric Ware <cedric.ware__bml@normalesup.org> wrote:
> Now that I've thought about it again, I added a similar check for the
> timeout value even though it's a zlong, and I documented that the
> interval is silently capped at LONG_MAX microseconds. Do you think
> it should be reported as an error instead?
Like i said, it doesn't seem to do much error-checking anywhere else, so i
guess it's consistent... but if it were me i'd probably make any out-of-range
value return an error, yeah.
On 6 Jan 2020, at 11:30, Cedric Ware <cedric.ware__bml@normalesup.org> wrote:
> Maybe. I believe CLOCK_MONOTONIC stops when the system is suspended;
> Linux has CLOCK_BOOTIME that adds the suspend time, but it's not
> portable. I don't know what would surprise users more between having
> SECONDS run backwards (which it could now), and not including suspend
> time (if it was changed to CLOCK_MONOTONIC).
Since it's mainly used for timing things i think that'd be fine, but maybe
there's something i'm not considering.
On 6 Jan 2020, at 11:30, Cedric Ware <cedric.ware__bml@normalesup.org> wrote:
> Thanks for the pointer. Yes, that could be done, though I don't have
> the time right now. What I actually had in mind was a test suite I
> could run to check that I didn't break anything elsewhere. Which is
> "make test", I should have thought of it. The current tests are still
> successful with the patch.
I'm slightly busy again too but i could try to write a script for it later.
It'd be going into 5.9 anyway
dana
next prev parent reply other threads:[~2020-01-07 3:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 20:35 Cedric Ware
2019-07-29 22:25 ` Bart Schaefer
2020-01-04 18:47 ` Cedric Ware
2020-01-05 18:42 ` dana
2020-01-05 21:49 ` dana
2020-01-06 17:30 ` Cedric Ware
2020-01-06 17:36 ` Peter Stephenson
2020-01-07 3:48 ` dana [this message]
2020-01-11 15:41 ` Cedric Ware
2020-01-11 19:36 ` dana
2020-01-12 4:25 ` dana
2020-03-08 18:39 ` Cedric Ware
2020-03-12 18:46 ` dana
2020-03-12 19:13 ` dana
2020-03-14 21:04 ` Cedric Ware
2020-03-15 0:50 ` Daniel Shahaf
2020-03-15 1:04 ` dana
2020-03-15 16:03 ` Cedric Ware
2020-03-15 16:54 ` Daniel Shahaf
2020-03-15 17:35 ` Peter Stephenson
2020-03-15 18:36 ` Cedric Ware
2020-03-15 19:13 ` Daniel Shahaf
2020-04-13 21:34 ` Cedric Ware
2020-04-14 11:47 ` Daniel Shahaf
2020-04-14 20:21 ` Cedric Ware
2020-04-15 1:15 ` Daniel Shahaf
2020-04-15 2:05 ` dana
2020-04-16 4:24 ` Daniel Shahaf
2020-04-18 16:32 ` Cedric Ware
2020-04-20 17:28 ` dana
2020-04-20 22:17 ` Cedric Ware
2020-03-15 1:04 ` Daniel Shahaf
2020-03-13 14:26 ` dana
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=F61E41A1-9EF2-4A45-96C7-E7AF516AC763@dana.is \
--to=dana@dana.is \
--cc=cedric.ware__bml@normalesup.org \
--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).