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 documented.

Stephen


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to