On Fri, 2008-09-26 at 17:23 +1200, Amos Jeffries wrote: > >> 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 I remember the kickReads() commit in a fuzzy way. I think it was > a quick hack to prevent CPU overload and delays on high-performance > sites when the list was large. Done without full knowlege of the > deferred reads code, then ported from 2.6 without fixing. > > > > > I think we can merge the two methods now because callbacks can no longer > > be reentrant. I will add a \todo. > > I wasn't criticizing the original design, merely making a point about > that is now may be easily fixable. The TODO is good if there is no time > or code-monkey minion to do a patch.
If you think it is now safe to empty the deferred readers list without counting or making a copy of it, I would be happy to remove duplication. Cheers, Alex.
