LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Jan Hudec <bulb@ucw.cz>, "Kernel, Linux" <linux-kernel@vger.kernel.org>
Subject: Re: Desperately missing a working "pselect()" or similar...
Date: Sat, 13 Oct 2001 18:05:09 +0200	[thread overview]
Message-ID: <20011013180509.E20499@kushida.jlokier.co.uk> (raw)
In-Reply-To: <3BC1D506.E68B9DB2@isg.de> <20011009153702.B28423@artax.karlin.mff.cuni.cz>
In-Reply-To: <20011009153702.B28423@artax.karlin.mff.cuni.cz>; from bulb@ucw.cz on Tue, Oct 09, 2001 at 03:37:02PM +0200

Jan Hudec wrote:
> Well, but you don't have to call sigsetjmp before every select; just when you
> enter the loop. Than just enable volatile flag, that the handler should now
> use the siglongjmp... well, you have to care about 2 signals quickly following
> one another and similar nasty cases anyway, so the pipe aproach is less
> error-prone.

You don't have to worry about 2 signals following each other if they are
the same signal: you can clear the volatile flag in the signal handler.

If they are different signals, e.g. SIGCHLD arrives during SIGINT
handler inside select(), then it's more complicated.

The pipe is very simple to get right and at least as fast as a signal
handler.  Just make sure you can't ever make the mistake of writing to a
full pipe.  Netscape 4.x does this and that's why it freezes from time
to time.  It's an easy problem to avoid.

-- Jamie

  reply	other threads:[~2001-10-13 16:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-08 16:32 lkv
2001-10-08 16:44 ` Alan Cox
2001-10-08 17:06   ` lkv
2001-10-08 17:24     ` Alan Cox
2001-10-09 13:37 ` Jan Hudec
2001-10-13 16:05   ` Jamie Lokier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-05 15:36 lkv
2001-10-05 16:19 ` Alexander Viro
2001-10-05 16:28   ` lkv
2001-10-05 16:36 ` Christopher Friesen
2001-10-05 16:40   ` lkv
2001-10-05 20:37 ` Bernd Eckenfels
2001-10-05 23:05   ` Alex Pennace
2001-10-05 23:13     ` Alan Cox
2001-10-05 23:52       ` Alex Pennace
2001-10-05 23:22     ` Neil Brown
2001-10-05 23:30       ` Alex Pennace
2001-10-05 23:43         ` David Schwartz
2001-10-06  0:03       ` Alan Cox

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=20011013180509.E20499@kushida.jlokier.co.uk \
    --to=lk@tantalophile.demon.co.uk \
    --cc=bulb@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Desperately missing a working "pselect()" or similar...' \
    /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

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).