Re: /dev/epoll on squid

From: Robert Collins <robertc@dont-contact.us>
Date: 24 Nov 2002 20:27:27 +1100

On Sat, 2002-11-23 at 08:00, David Nicklay wrote:
>
> This is my first attempt to get /dev/epoll working on squid. I am
> having problems getting it to work correctly, and I could use some
> help. I get a response on the first time I do a request, but I don't
> get anything on the second request.

Do you mean on a single client fd, or a single server fd, or do you mean
that the second accept() never occurs, or that it occurs and the request
never gets processed.

> Here are some things I have found about how epoll works that make things
> really difficult:
>
> - epoll apparently cannot tell you about events from before you began
> monitoring. I have a work around in place using poll with a zero
> timeout on a single fd when you first begin to monitor it. I make sure
> to perform the poll after the event has been added to the interest set
> in the epoll module.

Yeah, this is kindof expected, but also annoying :}. How much of a race
is there if the call sequence is:

connect()
epollnotifymeonthingy()

i.e. we don't delay at all?
or perhaps we need to do
connect()
epollnotifymeonthingy()
select() <- once!
  if select flag as neededing action foo on next io loop.

> - epoll is a notification based poll and as such it 'loses' events which
> you are not monitoring for. I have another workaround in place, where I
> basically look for all events and only handle those that I care about at
> any given moment.

I.e. if you are not watching for remote shutdowns, you are not told
about them? Thats cool. We should watch for most everything then. Can it
discriminate between link errors, remote shutdowns, ready to read, and
ready to write? If so, then we can start watching for everything, and
selectively remove certain items as we finish parts of the request.

Regarding your code sample, can you please provide a diff rather than a
copy of the while thing? It's much easier to review diffs :].

Lastly, squid-3.0 is much better suited to epoll() modification, as
there is a more event driven comms IO model, which should suit epoll()
nicely.

Cheers,
Rob

Received on Sun Nov 24 2002 - 03:26:13 MST

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