lkml.org 
[lkml]   [2002]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: epoll (was Re: [PATCH] async poll for 2.5)
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:30    [W:0.022 / U:124.772 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site