Davide Libenzi wrote:
>Why would you need to use threads with a multiplex-like interface like
>/dev/epoll ?
>
Because in some applications processing an event can cause the thread to
block, potentially for a long time. Multiple threads are needed to
isolate that block to the context associated with the event.
> while (read() == EGAIN)
> wait(POLLIN);
>
>
Assuming registration of interest is inside wait(), this has a race. If
the file becomes readable between the time that read() returns and the
time that wait() can register interest, the connection will hang.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:57 EST