Re: and nicer too - Re: [PATCH] epoll more scalable than poll

From: Davide Libenzi (davidel@xmailserver.org)
Date: Mon Oct 28 2002 - 20:13:53 EST


On Tue, 29 Oct 2002, bert hubert wrote:

> Ok, so that is two things that need to be in the manpage and probably in
> bold:
>
> 1) epoll only works on pipes and sockets
> (not on tty, not on files)
>
> 2) epoll must be used on non-blocking sockets only
> (and describe the race that happens otherwise)
>
> If you send me the source of your manpages I'll work it in if you want.

No problem ...

> I still vote for checking at insert time however unless that is too
> expensive. Yes, we want people to read the manpages and heed them, but we
> also not want to create interfaces that are needlessly errorprone.

This will make the API to be really error prone by giving the user the
impression that he can go sleeping for a given fd each time he wants. The
rule "you can wait for events only after you received EAGAIN" looks like a
very short and precise rule. On the contrary of "you can go wait for
events after you received EAGAIN or after accept/connect". And the fact on
using the fd immediately after an accept/connect is enforced by two very
likely facts :

1) on accept() it's very likely that the first packet brough you something
        more than SYN

2) on connect() you have the full I/O write space available

- Davide

-
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 : Thu Oct 31 2002 - 22:00:40 EST