lkml.org 
[lkml]   [2001]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Desperately missing a working "pselect()" or similar...
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.066 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site