[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: [zzdev] Re: gzigzag/src/util/test BenchPool.java

On Mon, Sep 03, 2001 at 09:24:51PM +0200, B. Fallenstein wrote:
> Tuomas Lukka wrote:
> > > And it's views, after all, for which pooling is most useful (because
> > > objects aren't kept for a long time). Or are there other important areas
> > > of application?
> > 
> > Needs two blockpools. That's all.
> No, unfortunately. Needs two blockpools per kind of object that can be
> created in a view, and a way for some function to know whether to use
> the first or the second pool. That interaction is actually quite hairy,
> given that we do not have all the time in the world to determine it--
> this MUST be fast. (Pass an additional parameter around everywhere
> !?!?!?) 

It doesn't actually need to be that fast since it only needs to be done once
for each *factory* when setting up e.g. the text vob production line.

VobScene.getPool(java.lang.Class) ?

> Also, why remember the "previous length" of the blockpool in the
> caller, instead of always releasing everything in the pool?

That's not a problem - calling setSize(0) is fine. Having a parameter just makes
it more flexible at no cost.