Re: commloops revisited

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Wed, 24 May 2006 18:00:57 +0200

ons 2006-05-24 klockan 22:32 +0800 skrev Adrian Chadd:
> I'd like to break the comm code out into per-commtype files; much like
> squid-3.

OK.

> Here's my first cut. They compile and run; I haven't done much
> testing on them. There's plenty more tidying up which can be done
> after this is in - mostly involving tidying up commSetSelect() and
> making the commDeferFD/commResumeFD calls part of the net API rather
> than just for epoll.

We also should get the comm pending stuff sorted out.

> I'd like to get this into squid-2.6 now so I or someone else can bring
> across kqueue/solaris epoll before 2.6 is released.

Looked almost fine to me, except that it appears you forgot to rip out
the poll code from comm_select.c....

Before commit this needs to be refined it a bit first. Do you have a
branch created for this in your monotone or devel.squid-cache?

  - poll code still in comm_select. Either rip it, or drop comm_poll.c.
  - lots of debug statement cleanups
  - need to take a broader view on the comm loops in general. A bit too
much code duplication which guarantees that some will bitrot more than
it already has..

but honestly this is starting to go a bit outside the intended scope of
2.6. Isn't bad, but a bit worried how to get all this done and verified
in the few days left..

> I also discovered some recent change to the select() code stopped it
> compiling; I've fixed it with what a cursory glance shows should be
> right. I'd appreciate someone verifying this.

You mean this:

- if (FD_ISSET(fd, &readfds) &&
fd_table[fd].flags.read_pending) {
+ if (FD_ISSET(fd, &readfds) && fd_table[fd].read_pending
& COMM_PENDING_NORMAL) {

unfortunately not correct.. see the poll loop. This btw got bitrotted by
the ssl update.

As you are not moving the select() code we do this: I fix up the pending
bits in the select loop, and you think about how these would fit into
the epoll loop...

Current status of the comm loops:

  - poll implemented quite crappily with lots of per loop scanning, but
supports the pending bits

  - select implemented reasonably good, but does not support the pending
bits

  - epoll some where inbetween, but does not support the pending bits

Regards
Henrik

Received on Wed May 24 2006 - 10:01:06 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Jun 01 2006 - 12:00:04 MDT