[lkml]   [2002]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectand nicer too - Re: [PATCH] epoll more scalable than poll
On Mon, Oct 28, 2002 at 02:29:37PM -0800, Davide Libenzi wrote:

> sys_epoll, by plugging directly in the existing kernel architecture,
> supports sockets and pipes. It does not support and there're not even
> plans to support other devices like tty, where poll() and select() works
> flawlessy. Since the sys_epoll ( and /dev/epoll ) fd support standard polling, you

Ok. I suggest the manpage mention this prominently.

I tried a somewhat more involved example and it indeed works expected. As an
application developer, this suits my needs just fine. I really like the
'edge' nature of it all.

The interface is also lovely:

for(;;) {
nfds = sys_epoll_wait(kdpfd, &pfds, -1);
fprintf(stderr,"sys_epoll_wait returned: %d\n",nfds);

for(n=0;n<nfds;++n) {
if(pfds[n].fd==s) {
client=accept(s, (struct sockaddr*)&local, &addrlen);

if (sys_epoll_ctl(kdpfd, EP_CTL_ADD, client, POLLIN ) < 0) {
fprintf(stderr, "sys_epoll set insertion error: fd=%d\n", client);
return -1;
printf("something happened on fd %d\n", pfds[n].fd);

Each time a packet comes in, sys_wait returns just once so I can immediately
call it again without having to wait for another thread to have actually
*done* something with that socket.

Righteous stuff, I'll be using this, thanks.



-- Versatile DNS Software & Services Linux Advanced Routing & Traffic Control HOWTO
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:30    [W:0.075 / U:0.088 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site