Re: fixing deferred reads

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 25 Sep 2008 23:10:10 -0600

On Fri, 2008-09-26 at 13:35 +1200, Amos Jeffries wrote:
> > On Thu, 2008-09-25 at 13:43 -0600, Alex Rousskov wrote:
> >>
> >> I can probably fix it myself, but it would help a lot if somebody
> >> could
> >> document (briefly!) the overall purpose of deferred reads and the
> >> exact
> >> purposes of these two nearly identical methods (one brief description
> >> for each, please):
> >
> > From memory...
> >
> >> DeferredReadManager::kickReads(int const count)
> >
> > do up to count reads that have been deferred
> >
> >
> >> and
> >>
> >> DeferredReadManager::flushReads()
> >
> > do all reads
> >
>
> Which makes more sense then to cleanup make flushReads() == kickReads(-1),
> or similar instead of duplication.

Avoiding duplication was not "possible" when the class was written
because of the reentrant callbacks and lack of size() accounting in the
cbdata list used by the class. The author was, apparently, worried that
the reads list will grow as it is being emptied, causing an infinite
loop.

I think we can merge the two methods now because callbacks can no longer
be reentrant. I will add a \todo.

Thank you,

Alex.
Received on Fri Sep 26 2008 - 05:10:22 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 26 2008 - 12:00:05 MDT