[concurrency-interest] CallerRunsOrRejects for JDK8?
viktor.klang at gmail.com
Sat May 12 13:05:35 EDT 2012
On Sat, May 12, 2012 at 6:59 PM, Aleksey Shipilev <
aleksey.shipilev at gmail.com> wrote:
> On Sat, May 12, 2012 at 8:39 PM, √iktor Ҡlang <viktor.klang at gmail.com>
> > How about this for inclusion in JDK8?
> I also sometimes miss CallerBlocks policy, which:
> - throws RejectedExecutionException when pool is shutting down
> - blocks until executor accepts the task, and returns after successful
> This is helpful when I specifically don't want submitter to execute
> tasks slated to be executed in the threadpool (i.e. CallerRuns is not
> something I want). It was especially problematic when the task at hand
> is rather heavy, and by the time submitter is done executing the task,
> threadpool is had been long idle already, because submitter is, well,
Yup, in my experience, I don't see any situation where you'd like
CallerRunsPolicy, as it just silently drops tasks when TPE isShutdown.
As a sidenote, it'd be nice to have an AsyncExecutor, which is never
allowed to do caller-runs at all. Some code might rely on the block not
being executed on submission.
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest