Re: ThreadPoolExecutor - cancel rejected tasks with Discard*Policy?
Viktor Klang via Concurrency-interest <[email protected]>
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CANPzfU-TwXUOWjgrkCx4m4mM5e-Q29G7FtkOkXz+RnG4gp-+0Q@mail.gmail.com> |
On Mon, Feb 17, 2020 at 12:03 PM Doug Lea via Concurrency-interest < [email protected]> 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 > [email protected] > http://cs.oswego.edu/mailman/listinfo/concurrency-interest > -- Cheers, √ _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest