[stdlib-sig] futures - a new package for asynchronous execution
brian at sweetapp.com
Fri Nov 13 06:19:40 CET 2009
On Nov 8, 2009, at 6:37 AM, Jeffrey Yasskin wrote:
> --- More general points ---
> ** Java's Futures made a mistake in not supporting work stealing, and
> this has caused deadlocks at Google. Specifically, in a bounded-size
> thread or process pool, when a task in the pool can wait for work
> running in the same pool, you can fill up the pool with tasks that are
> waiting for tasks that haven't started running yet. To avoid this,
> Future.get() should be able to steal the task it's waiting on out of
> the pool's queue and run it immediately.
I understand the deadlock possibilities of the executor model, could
you explain your proposal would work?
Would it be some sort of flag on the Future.get method e.g.
More information about the stdlib-sig