[Fwd: Re: squid using /dev/epoll]

From: David Nicklay <dnicklay@dont-contact.us>
Date: 25 Nov 2002 14:19:58 -0500

According to Davide Libenzi, the system call interface to epoll is the
way to go. He believes that it will be backported to 2.4.x as a patch.
I am going to retry what I was doing using that instead as soon as I can
get a 2.5 kernel to finish making on my test box. Hopefully that will
solve the problem of having to call poll()/select() initially on a fd.

-----Forwarded Message-----

> From: Davide Libenzi <davidel@xmailserver.org>
> To: David Nicklay <dnicklay@web.turner.com>
> Subject: Re: squid using /dev/epoll
> Date: 25 Nov 2002 09:46:57 -0800
>
> On Mon, 25 Nov 2002, David Nicklay wrote:
>
> >
> > Hi,
> >
> > I wonder if you might assist me in debugging a patch I am making against
> > squid to allow it to support epoll. I have it almost working, though I
> > need some help with some issues with it.
> >
> > squid is here:
> > http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE1.tar.gz
> > and the patch is attached.
> >
> > - I have a hack in place at the moment to use poll() with a zero timeout
> > in order to get around notifications that happen before registering
> > interest in fds to epoll. There has been some thought that simply
> > registering our interest in a fd immediately after an accept() might be
> > enough, and I have noticed ephttpd does in fact do this. Is there a
> > problem with race conditions doing this, and if so would a quick select
> > on a single fd be enough to fix this?
> >
> > Also, there is a bug in my code above, where the first request works,
> > but the second request on the the same fd number doesn't. I am still
> > trying to figure out if it is my code causing this or not.
> >
> > Hope you can help! :)
>
> Guys, please. Do not use /dev/epoll because it won't be supported in the
> next kernel. Use the new epoll system call interface that will avoit the
> poll() trick and also will support a wide variety of file descriptors (
> where /dev/epoll supports onlt sockets and pipes ). You need the latest
> kernel 2.5.49 plus this patch ( that will be merged in 2.5.50 ) :
>
> http://www.xmailserver.org/linux-patches/sys_epoll-2.5.49-0.58.diff
>
> The latest API is documented here :
>
> http://www.xmailserver.org/linux-patches/epoll.txt
> http://www.xmailserver.org/linux-patches/epoll.4
> http://www.xmailserver.org/linux-patches/epoll_create.txt
> http://www.xmailserver.org/linux-patches/epoll_create.2
> http://www.xmailserver.org/linux-patches/epoll_ctl.txt
> http://www.xmailserver.org/linux-patches/epoll_ctl.2
> http://www.xmailserver.org/linux-patches/epoll_wait.txt
> http://www.xmailserver.org/linux-patches/epoll_wait.2
>
> A few bits inside the man pages might change ( epoll.4 maybe heavily ) but
> the API should be pretty much fixed right now. An access library is
> available here :
>
> http://www.xmailserver.org/linux-patches/epoll-lib-0.3.tar.gz
>
> This will go in glibc and will garantie that your code won't be wasted.
> Also the interface is really better.
>
>
>
>
> - Davide

-- 
David Nicklay
Location: CNN Center - SE0811A
Office: 404-827-2698	Cell: 404-545-6218
Received on Mon Nov 25 2002 - 12:16:17 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:18:49 MST