[concurrency-interest] Coordinated Runnables

Alexei Kaigorodov alexei.kaigorodov at gmail.com
Thu Aug 29 08:09:33 EDT 2013


Package java util.concurrent provides many facilities to synchronize
threads, but none to coordinate tasks running on a thread pool. Generally,
using thread synchronization in tasks is undesirable, as synchronization
blocks pooled threads and may lead to thread starvation or, if unlimited
pool is used, leads to uncontrolled growth of the number of threads and so
eliminating the advantages of thread pool. However, non-blocking
synchronization facilities are essential for developing complex asynchronous
programs.

An illustrative example of how coordinated runnables can work and what
support is required can be found at
https://docs.google.com/document/d/1a-ycXfvVtDExDRBLKCukSjDQHlyidrVE7yV27jlEmrs
.

I also have and implementation of the proposed execution model at
https://github.com/rfqu/df4j.

I believe, for the sake of completeness, standard java libraries must
include non-blocking sychronization facilities. Dot Net platform has Task
Parallel Library (TPL), Groovy has GPars, and java lags behind.




More information about the Concurrency-interest mailing list