Re: ThreadPoolExecutor - cancel rejected tasks with Discard*Policy?

Doug Lea via Concurrency-interest <[email protected]>
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
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.

-Doug



_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.