[concurrency-interest] Re: PooledLinkedBlockingQueue

Larry Riedel larryr@saturn.sdsu.edu
1 Nov 2004 20:44:02 -0000

> It seems that if objects are expensive enough to create
> that you want to preserve them, then you should be using a
> factory creation and disposal mechanism that allows you to
> manage the lifecycle explicitly.
> If it's expensive to adapt existing code to do this, then
> you've really got a different issue about design and where
> you are at in the lifecycle of the architecture.

I think whether or not there is factory, and whether
or not an object pool manager depends on the garbage
collector to keep track of object reachability, are
separate things.  I would expect there to typically be
a factory for pooled objects, and I think it should be
just fine to depend on the garbage collector to let the
pool manager know when a pooled object is no longer
reachable, rather than the pool manager requiring its
users to keep track of that; indeed I do not think the
pool manager should necessarily even require its end
users to be aware that the objects are pooled at all.