[concurrency-interest] ThreadPoolExecutor - cancel rejected tasks with Discard*Policy?

Petr Janeček JanecekPetr at seznam.cz
Tue Feb 18 06:38:49 EST 2020

> From: Doug Lea <dl at cs.oswego.edu>
> Datum: 16. 2. 2020 15:43:13
> Subject: Re: [concurrency-interest] ThreadPoolExecutor - cancel rejected tasks with Discard*Policy?
> [...] Probably we'll just add documentation. See the draft embedded example at:
> http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java.base/java/util/concurrent/ThreadPoolExecutor.DiscardOldestPolicy.html
> Plus a few added sentences in TPE documentation
> http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java.base/java/util/concurrent/ThreadPoolExecutor.html

Thank you, that's very clear.
I would personally like a new policy, too, but I admit its usage is probably
obscure enough that it would not hold its own weight.
> We could add @Deprecated(forRemoval=false), but I'm not sure how much
> this would help. There are a few legitimate uses for it, and that code
> would now encounter warnings.

Agreed, I subjectively do not think @Deprecated is warranted in this case.


More information about the Concurrency-interest mailing list