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

Viktor Klang 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


>
> -Doug
>
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>


-- 
Cheers,
√
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20200217/146addf3/attachment.htm>


More information about the Concurrency-interest mailing list