[concurrency-interest] DirectByteBuffers and reachabilityFence

thurstonn thurston at nomagicsoftware.com
Tue Dec 15 16:06:26 EST 2015


So will DelegatedExecutorService be refactored to include reachabilityFence()
calls where appropriate?
e.g.

public Future<?> submit(Runnable task) {
            return e.submit(task);
        }

becomes

public Future<?> submit(Runnable task) 
{
            Future<?> result = e.submit(task);
            reachabilityFence(this);
            return result;
}

that would ameliorate (although not eliminate) the issue


Doug Lea wrote
> On 12/15/2015 12:43 PM, Martin Buchholz wrote:
>> Part of the problem is that there are two finalize methods in play here.
>> The implementation does
>>
>>      public static ExecutorService newSingleThreadExecutor() {
>>          return new FinalizableDelegatedExecutorService
>>              (new ThreadPoolExecutor(1, 1,
>>
>> so the outer executor may get finalized while methods on the inner are
>> still executing.
>>
>> Not sure of the motivation for the finalization strategy here.
> 
> See http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6399443
> and concurrency-interest discussion in March 2006 with subject
>    Finalization changes to DelegatedExecutorService
> http://cs.oswego.edu/pipermail/concurrency-interest/2006-March/thread.html
> 
> Without this, some users were leaking Executors/Threads.
> This is arguably not our (j.u.c) problem.
> But after some resistance, we decided to add the finalizer.
> With it, users may encounter surprisingly early shutdown without
> reachabilityFence.
> 
> -Doug
> 
> 
> 
> 
> 
> _______________________________________________
> Concurrency-interest mailing list

> Concurrency-interest at .oswego

> http://cs.oswego.edu/mailman/listinfo/concurrency-interest





--
View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/DirectByteBuffers-and-reachabilityFence-tp12935p13089.html
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.


More information about the Concurrency-interest mailing list