[concurrency-interest] Re: PooledLinkedBlockingQueue

Gregg Wonderly gregg.wonderly@pobox.com
Tue, 02 Nov 2004 16:51:04 -0600


Larry Riedel wrote:
> That looks right as far as what I prefer not to do-- have to
> create/destroy an object for each call to getInstance().  I
> want to have a WeakReference to a pooled object, which gets
> put in a ReferenceQueue for the pool manager after it is no
> longer strongly reachable; when the pooled object shows up
> in the ReferenceQueue, it gets reset and put back in the
> pool; in the dotNET CLR I can call the ReRegisterForFinalize
> to complete the resurrection; in Java/JVM, an object can
> only become eligible for finalization once, so a particular
> object instance will only get put into a ReferenceQueue once
> during its lifetime.  By the way, I am not saying I think
> this is a /clean/ way to achieve the end result of utilizing
> the services of the garbage collector for tracking object
> reachability without having it also control the lifecycle...
> it is just /a/ way.

I understand the issue of the CLR having and JVM not having.  CLR 
doesn't have a built in security model for downloaded code.  So I guess 
I shouldn't use the CLR?  There are great ways to do certain things and 
ways less great.  The JCP lets YOU make an issue become less of an 
issue.  With the CLR, you get to wait until MS decides to do it.  I 
don't want to start an us and them war, but I think that anyone 
interested in having the JVM do something different than it does now, 
should make an effort to make that happen.  Doug Lea and company stepped 
up to the plate to make this lists project a reality.

If you really think this would be a good thing to have, then maybe there 
is someone (including yourself) who could make it happen so that 
everyone using Java would be able to utilize such facilities.  Proposing 
a project for the JCP, and then collecting your expert team might be all 
you need to do.  The team might do the rest for you.

Gregg