Messages in this thread | | | Date | Mon, 18 Jan 1999 23:22:41 +0000 | From | Jamie Lokier <> | Subject | Re: Netscape broken with 2.2.0-pre7 |
| |
On Sun, Jan 17, 1999 at 07:36:43PM +0100, Andi Kleen wrote: > > It doesn't look like a signal thing so much as an abuse of a pipe. It's > > pretty clear Netscape _could_ use an internal circular buffer instead of > > an OS pipe. Then again, maybe that would just add to the many memory > > leaks :-) > > It can't. You can't poll a circular buffer in a select/poll. That is why > the self pipe trick is often used to pass information from signal handlers > to the main loop.
You don't need to poll the buffer in select/poll. On entry to select, if the buffer is non-empty, don't call select... (simple :-)
If a signal handler inserts into the buffer, it can interrupt the select call (with EINTR), which can check the buffer before trying again.
-- 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/
| |