[concurrency-interest] Re: PooledLinkedBlockingQueue

Larry Riedel larryr@saturn.sdsu.edu
1 Nov 2004 23:08:02 -0000


> > 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.
> 
> If the GC has to tell the factory that it's done with the
> object, why would that be 'better' than for the application
> to tell the factory it is done, explicitly.  The extra code
> in the application would seem to be negligable.

As an application developer, I generally prefer to have
the garbage collector track object references, rather than
requiring the application code to do it; that is why I
want garbage collection-- to relieve the application code
of the burden of tracking object references; and there is
nothing about objects which are pooled/cached rather than
created/destroyed which fundamentally changes this for me--
leads me to think users of objects which happen to have come
from a pool should even have to know if the objects they use
are pooled/cached vs created/destroyed.


Larry