[lkml]   [2000]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Signals lost when using asynchronous IO
On Wed, 12 Jul 2000, you wrote:
> I'm trying to use non-blocking asynchronous IO, setting a user-defined
> real-time signal to be sent when IO is completed on a socket. This works
> fine most of the time, and I get the specified signal when new data is
> available. However, sometimes signals appear to be lost. Debugging
> indicates that this happens when the remote end closes the socket. The
> problem only occurs when there are many sockets active, all using
> asynchronous IO, and many signals are to be sent. And, yes, I do check for
> SIGIO signals too, but none are sent (i.e. the IO list is not saturated).
> The sockets are created as (AF_INET, SOCK_STREAM), and are set to be
> O_NONBLOCK|O_ASYNC using fcntl(). The user-defined signal is the first
> real-time signal (value 32).
> Is this a known problem, and if so, is there a work-around?
> System: i386 (Pentium II)/Red Hat Linux release 6.0 (Hedwig)
> Kernel: 2.2.16
> Thank you,
> Mikael

I have done a lot of testing with async i/o with the kernel that comes with
RH6.2 which is the same as you're referencing. On close a POLL_HUP and then a
POLL_IN get sent to the app. I'm using sigtimedwait && sigwaitinfo rather than
poll. If you're looking for sample implementations you can get phhttpd at, or I just put up a sample implementation which is designed to be a
sigio library (just beginning few bugs hanging around) its on anon ftp at . The source is very small and it's pretty
easy to understand. I can't help but think possibly your implementation is off
because I haven't experienced the problems your speaking of, are you removing
the O_ASYNC flag before the close event or something?

Anyhoo, for a lot of people generally interested in async io you may want to
check out the phhttpd list, instructions are on You might want
to repost to that list, Chuck, Zach, Stephen, Andi and myself are known to
answer there. (Though my kernel's been Oopsing lately in the response category
<this is a joke, attempted one anyway>)


(Phhttpd has handling code for both signal driven and poll, so it might be more
interesting to you. The present version is designed for your kernel version as
well as that's the one Chuck Lever runs and he put out the last revision.)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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