zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Can periodic hook stop rescheduling?
Date: Tue, 13 Sep 2016 15:34:02 +0200	[thread overview]
Message-ID: <CAKc7PVC7Gya8F013d-yLwFUSZicJZGHD7puFxv3KcPzNOmNuYA@mail.gmail.com> (raw)
In-Reply-To: <20160913142003.480cfd9c@pwslap01u.europe.root.pri>

On 13 September 2016 at 15:20, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Tue, 13 Sep 2016 10:49:35 +0200
> The function that's being called is certainly not immune from getting
> ^C, and that can certainly stop "sched +2" in its tracks just like any
> other command.  The only general fix for this would be blocking SIGINT
> sufficiently early that ^C doesn't hit this and restoring it later ---
> but given sched +2 is the first line of the script anyway that doesn't
> look promising.

Blocking INT is the second thing done in the function:

    setopt localtraps; trap '' INT

I thought: sched will run faster than "setopt localtraps..." and this
way give better guarantee that rescheduling will not be stopped. So I
chosen to sched first, then block trap, but can reverse that, no
problem.

> You might have better results with
>
>   {
>     ...
>   } always {
>     sched +2 ...
>   }
>
> but it's still subject to the same problem if the ^C happens at the
> wrong point.
>
> This may need some lateral thinking.

"always" looked promising, too bad it's still subject to Ctrl-C

Best regards,
Sebastian Gniazdowski


      reply	other threads:[~2016-09-13 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160913085130eucas1p19723ac09c11d596542360173e4a4b308@eucas1p1.samsung.com>
2016-09-13  8:49 ` Sebastian Gniazdowski
2016-09-13 13:20   ` Peter Stephenson
2016-09-13 13:34     ` Sebastian Gniazdowski [this message]

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=CAKc7PVC7Gya8F013d-yLwFUSZicJZGHD7puFxv3KcPzNOmNuYA@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-users@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).