[concurrency-interest] the remove-on-cancel policy on ScheduledThreadPoolExecutor
jason_mehrens at hotmail.com
Tue Aug 31 18:03:14 EDT 2010
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.
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.
I suppose that given the age difference between the two bugs there has been a lot of JVM changes.
> 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.
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest