Re: Changes in the sockets: SIGIO handling

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue Mar 07 2000 - 16:32:12 EST


kuznet@ms2.inr.ac.ru wrote:
> > If you've got a partial read's worth of data pending, you shouldn't be
> > sleeping.
>
> 1. MSG_WAITALL
> 2. SO_RCVLOWAT

These aren't correct. (Correct for the sentence you quoted, but not its
context). I should have said: If you've got a partial read's worth of
data pending, you should return immediately -- without sleeping.

> 3. write(), which always implies not-existing MSG_WRITEALL.

?? I don't understand. This affects read() somehow?

> > empty when you went to sleep), you should wake up and return -EINTR,
>
> And lose the event in any case.

You don't lose the event. The syscall returns, the signal is delivered,
then the interrupted code continues with EINTR. Or, if the signal is
blocked, it is queued (if RT) or made pending (non RT).

> > Well you don't have to do that, but that allows you to avoid this
> > particular "event lost" bug.
>
> Listen, I do not try to prove that it is a "bug". 8)
>
> I try to argue exactly that over-signaling proposed here as "good thing"
> is true bug.

:-) Fair enough; I hope you can see that there is a way to reduce the
over-signalling without breaking applications.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:23 EST