Re: A signal fairy tale

Christopher Smith
2001-06-29T08:31:20Z

At 01:11 PM 6/28/2001 -0700, Daniel R. Kegel wrote:
>AFAIK, there's no 'read with a timeout' system call for file descriptors, so
>if you needed the equivalent of sigtimedwait(),
>you might end up doing a select on the sigopen fd, which is an extra
>system call. (I wish Posix had invented sigopen() and readtimedwait()
>instead of
>sigtimedwait...)

What, you don't want to use AIO or to collect your AIO signals? ;-)

In my apps, what I'd do is spawn a few worker threads which would do
blocking reads. Particularly if the sigopen() API allows me to grab
multiple signals from one fd, this should work well enough for one's high
performance needs. Alternatively, one could use select/poll to check if
there was data ready before doing the read. I agree though that it'd be
nice to have a timed read.

--Chris