Re: accept() improvements for rt signals

From: Dean Gaudet (dgaudet-list-linux-kernel@arctic.org)
Date: Mon Feb 21 2000 - 23:00:19 EST


On Mon, 21 Feb 2000, Dan Kegel wrote:

> Ghost read events can confuse user code and make it think it's hit
> the end of file. Translating your example
> while (read(s) > 0) {};
> close(s);
> to event-driven pseudocode yields
> do {
> sigtimedwait(...)
> ...
> if (event is 'fd now readable') {
> if (read(fd) == 0) {
> terminate connection, other end closed
> }
> }
>
> A ghost read event could cause this code to terminate a new connection prematurely.
> This isn't a performance problem, it's a reliability problem.

hmm? i don't see how that could be. the "ghost" is just an event, when
you do the actual read() you'll get back a true value -- you most
certainly won't get an EOF unless the fd is at eof.

Dean

-
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 : Wed Feb 23 2000 - 21:00:29 EST