zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: sleep $floatval
Date: Mon, 02 Sep 2013 11:09:05 -0700	[thread overview]
Message-ID: <130902110905.ZM26303@torch.brasslantern.com> (raw)
In-Reply-To: <20130902023340.GA14105@redoubt.spodhuis.org>

On Sep 1,  7:33pm, Phil Pennock wrote:
}
} Say I do add a zsleep command; if the sleep returns EINTR, then before

Hmm, sleep is a library call, not a system call, and isn't documented as
setting errno to anything useful, so you must be planning on implementing
the delay some other way?

} going back to sleep for the remainder of the duration, the command could
} report on reaped jobs immediately, so that instead of being pre-prompt,
} job termination could be reported immediately during the length of the
} sleep.

That might be better expressed explicitly (even if implemented the same
way underneath) by providing a variant of "wait" that has a timeout,
rather than by having a variant of "sleep" that does it implicitly.

} (At which point, zsleep might as well take an option giving it a
} function list variable to be be walked, any time it is woken up, to let
} arbitrary handlers be invoked, before resuming sleep, and possibly with
} a way to abort and avoid going back to sleep).

What happens if a handler invokes zsleep again with a different list of
functions?  Also, how do you plan to keep track of whether the original
sleep time has expired while the handlers were executing?

Other problems of having a builtin sleep include defining the interaction
with signal handlers, particularly the ALRM handler.


  reply	other threads:[~2013-09-02 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31 23:47 Phil Pennock
2013-09-01  7:45 ` Bart Schaefer
2013-09-01  8:16   ` Phil Pennock
2013-09-01 17:29 ` Peter Stephenson
2013-09-02  2:33   ` Phil Pennock
2013-09-02 18:09     ` Bart Schaefer [this message]
2013-09-03  3:05       ` Phil Pennock

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=130902110905.ZM26303@torch.brasslantern.com \
    --to=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).