Re: epoll (was Re: [PATCH] async poll for 2.5)

John Myers (jgmyers@netscape.com)
Fri, 18 Oct 2002 18:05:18 -0700


Charles 'Buck' Krasic wrote:

>Or we could have (to make John happier?):
>
>1 for(;;) {
>2 fd = event_wait(...);
>3 if(fd == my_listen_fd) {
>4 /* new connections */
>5 while((new_fd = my_accept(my_listen_fd, ...) != EAGAIN)) {
>6* epoll_addf(new_fd, &pfd, ...);
>7* if(pfd.revents & POLLIN) {
>7* while(do_io(new_fd) != EAGAIN);
>8* }
>8 }
>9 } else {
>10 /* established connections */
>11 while(do_io(fd) != EAGAIN)
>12 }
>13 }
>
>
Close. What we would have is a modification of the epoll_addf()
semantics such that it would have an additional postcondition that if
the new_fd is in the ready state (has data available) then at least one
notification has been generated. In the code above, the three lines
comprising the if statement labeled "7*" would be removed.

-
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/