Re: Changes in the sockets: SIGIO handling

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue Mar 07 2000 - 13:18:34 EST


kuznet@ms2.inr.ac.ru wrote:
> But do not forget that even generation of such signals is not a zero
> overhead, which can be saved as rule. F.e. both old and rt signals
> are not generated at all when someone _sleeps_ in read()/write().
> >From the viewpoint of previous mails, it is bug. Look, another
> signal may wake us, then read() returns partial read. Oops, event is lost.

If you've got a partial read's worth of data pending, you shouldn't be
sleeping. If you receive a signal during sleep (because the buffer was
empty when you went to sleep), you should wake up and return -EINTR,
even if the buffer is partially full now.

Well you don't have to do that, but that allows you to avoid this
particular "event lost" bug.

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