Re: remove deferred reads

From: Robert Collins <robertc@dont-contact.us>
Date: 04 Mar 2003 07:41:38 +1100

On Tue, 2003-03-04 at 00:28, Henrik Nordstrom wrote:
> mån 2003-03-03 klockan 11.59 skrev Robert Collins:
>
> > It
> > * removes deferred reads across the board
> > * converts nearly all unready reads to the new DeferredRead framework.
> > * leaves ssl reading 1 byte per IO cycle at minimum.
> > * Includes David Nicklay's epoll patch.
>
> A short description of the DeferredRead framework and its external
> operation would be nice, but you have my go ahead anyway.

Thank you.

I'll put something in the programmers guide next weekend, I hope. For
now:

We have
CommRead <- all the data needed to hand a read request to the comms
layer.
DeferredRead <- a CommRead, and a defer aware reader and it's context.
DeferredReadManager <- manages DeferredReads for the deferer.

I.e.
Each Delay pool has a DeferredReadManager. When assigned a deferred read
(via the delayRead(DeferredRead const &) call), the manager queues the
read, and waits to be kicked. The delay pools code kicks reads out of
the deferred queue whenever traffic for that pool is registered, or if
the pool is shutdown (i.e. due to reconfiguration).

When a read is kicked, the defer aware reader is called, along with it's
context. Today, there is only one defer aware reader -
StoreEntry::DeferReader, and the context data is the store entry.

The Deferred Read Manager handles tracking closed fd's and automatically
drops the read request on the floor.

Finally, there are two DeferredReadManagers used: One in each MemObject,
and one in each CompositePoolNode.

The DeferredReadManager is owned by the triggering object, to ease use.
Otherwise we'd need need two separate objects: a vector of notifiable
objects that have been deferred, and a container for the deferred
objects. That didn't give any appreciable flexability, given the ease of
composing a DeferredReadManager, thus I took the simpler approach.

Rob

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Received on Mon Mar 03 2003 - 13:41:49 MST

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