commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [pool] Proposal: New Pool Impl -- GeneratorObjectPool
Date Sat, 01 Apr 2006 13:53:52 GMT
Peter Steijn wrote:
> GeneratorObjectPool changes the behavior of object pooling in the
> borrowObject method.  Previous object pooling implementations, when
> attempting to borrow an object from an empty pool, would create an object
> for the requestor; blocking until the object was created and then returning
> that object.  This is especially inefficient for object pooling...
> <snip>
> GeneratorObjectPool does not block to create an object when a request hits
> an empty pool.  Instead it schedules a TimerTask to run at the earliest time
> possible.  This TimerTask creates an object and puts it into the pool.
> While the TimerTask is running, the requestor is looking for any object to
> return to the pool, not just the one that it asked to be created.

This sounds like a good enhancement to [pool]. As you indicated a JDK1.3 
version would be useful.

Also, I don't think it saves any time if you create the pool and then 
immediately extract an object from the pool, so that would need to be 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message