Messages in this thread | | | Date | Fri, 18 Oct 2002 12:02:10 -0700 | From | John Gardiner Myers <> | Subject | Re: epoll (was Re: [PATCH] async poll for 2.5) |
| |
Davide Libenzi wrote:
>Look, I'm usually very polite but you're really wasting my time. You >should know that an instruction at line N is usually executed before an >instruction at line N+1. Now this IS your code : > >[N-1] for (;;) { >[N ] fd = event_wait(...); >[N+1] while (do_io(fd) != EAGAIN); >[N+2} } > >I will leave you as an exercise to understand what happens when you call >the first event_wait(...); and there is still data to be read/write on the >file descriptor. > Your claim was that even if the API will drop an event at registration time, my code scheme would not work. Thus, we can take "the API will drop an event at registration time" as postulated. That being postulated, if there is still data to be read/written on the file descriptor then the first event_wait will return immediately.
In fact, given that postulate and the appropriate axioms about the behavior of event_wait() and do_io(), one can prove that my code scheme is equivalent to yours. The logical conclusion from that and your claim would be that you don't understand how edge triggered APIs have to be used.
>The reason you're asking /dev/epoll to drop an event at >fd insertion time shows very clearly that you're going to use the API is >the WRONG way and that you do not understand how such APIs works. > The wrong way as defined by what? Having /dev/epoll drop appropriate events at registration time permits a useful simplification/optimization and makes the system significantly less prone to subtle progamming errors.
I do understand how such APIs work, to the extent that I am pointing out a flaw in their current models.
>And the fact that there're users currently using the rt-sig and epoll APIs means >that either those guys are genius or you're missing something. > > Nonsense. People are able to use flawed APIs all of the time.
- 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/
| |