[concurrency-interest] PooledExecutor vs java.util.concurrent

Alexey N. Solofnenko A.Solofnenko at mdl.com
Tue May 17 21:15:46 EDT 2005



Tim Peierls wrote:

> I suppose you could extend SynchronousQueue with an offer method that 
> does block. But I don't understand why you *want* to block the calling 
> thread. You could use CallerRunsPolicy to run the rejected task in the 
> calling thread, which would be like blocking, except it would get some 
> work done. You could use the default policy and catch 
> RejectedExcutionException, do some work, and try again. Both of these 
> seem preferable to just sitting there indefinitely waiting for the 
> pool to open up.
>
One would not want to do that to limit a number of concurrently executed 
tasks.

- Alexey.

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


-- 
------------------------------------------------------------------------
/ Alexey N. Solofnenko
home: http://trelony.cjb.net/
/


More information about the Concurrency-interest mailing list