[concurrency-interest] ThreadPoolExecutor - cancel rejected tasks with Discard*Policy?
viktor.klang at gmail.com
Mon Feb 17 09:09:07 EST 2020
On Mon, Feb 17, 2020 at 12:03 PM Doug Lea via Concurrency-interest <
concurrency-interest at cs.oswego.edu> wrote:
> On 2/16/20 10:16 AM, Viktor Klang via Concurrency-interest wrote:
> > The real downside with CallerRunsPolicy is that it discards Runnables
> > when the pool is shutting down, which means that in all cases where
> > there might be a race condition between shutting down and submitting
> > tasks, they may not get run at all :S
> Some people would complain about the opposite policy choice as a
> downside. The main moral for JDK components is that predefining only a
> few of many possibly policies for the sake of convenience is not usually
> a good idea.
Yeah, "There is no optimal, general, solution." - Old Klangian Proverb
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest