[concurrency-interest] ExecutorCompletionService is dangerous for critical app!?

Doug Lea dl at cs.oswego.edu
Fri Aug 11 19:49:32 EDT 2006


yangjs wrote:
>     This is my custom implementation of the CompletionService interface.
> Can I use this impl for my work?
> 

Yes, this seems reasonable. You will still sometimes lose
tasks (on interrupt), but presumably your application can cope
with this.

-Doug


> 
>   protected void done() {
>    if (isBlocking) {
>     try {
>      completionQueue.put(this);
>     } catch (InterruptedException e) {
>      Thread.currentThread().interrupt();
>      cancel(true);
>     }
>    } else {
>     completionQueue.add(this);
>    }
>   }
>  }


More information about the Concurrency-interest mailing list