[concurrency-interest] the remove-on-cancel policy on ScheduledThreadPoolExecutor

Jason Mehrens jason_mehrens at hotmail.com
Tue Aug 31 18:03:14 EDT 2010


Kasper,
 
Agreed.  One would think that the stored callable could be a root of a larger object graph.  I suppose the preferred method is to create nice callable or create wrapper callable around the offending target callable.
 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213323
 
If futures and executors replace thread creation I don't really see why nulling a future task callable is any different from nulling the target field in a thread.
 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4006245
 
I suppose that given the age difference between the two bugs there has been a lot of JVM changes.
 
Regards,
 
Jason
 
> Date: Tue, 31 Aug 2010 20:44:11 +0200
> From: kasper at kav.dk
> To: concurrency-interest at cs.oswego.edu
> Subject: Re: [concurrency-interest] the remove-on-cancel policy on ScheduledThreadPoolExecutor
> 
> On 31/08/10 17.51, Doug Lea wrote:
> >
> > The story on this is that it was (and presumably still is)
> > Sun/Oracle policy not to introduce API changes between
> > major releases. So even though we have had a version with
> > setRemoveOnCancelPolicy in our jsr166 CVS for years now,
> > the only distributed version is in openjdk7 (as well as
> > the jdk7 binary snapshots). And while it is a little
> > painful to set up, you can always get a copy from us
> > (either standalone or part of jsr166.jar) and place in your
> > bootclasspath to use it with JDK6+. (Get it via links at
> > http://gee.cs.oswego.edu/dl/concurrency-interest/index.html)
> >
> > -Doug
> > _______________________________________________
> > Concurrency-interest mailing list
> > Concurrency-interest at cs.oswego.edu
> > http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> >
> 
> Would it make sense to at least clear the reference to the 
> runnable/callable on future.cancel() to allow it to be gc'ed?
> 
> I haven't ever been bugged down by this but I could imagine some people 
> might have.
> 
> Cheers
> Kasper
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20100831/5b4b5407/attachment.html>


More information about the Concurrency-interest mailing list