[concurrency-interest] j.u.c.Phaser tutorial?

Ashwin Jayaprakash ashwin.jayaprakash at gmail.com
Mon Aug 1 16:06:29 EDT 2011

Why doesn't the main thread just call arrive() at the end?  I guess only for
clarity - to show that only x worker threads (minus 1 starter thread) are
required for the processing.

On Sun, Jul 31, 2011 at 3:47 PM, David Holmes <davidcholmes at aapt.net.au>wrote:

> **
> Ashwin,
> > I learned later that the arriveAndDeregister() method makes sense only
> when you create a hierarchy of phasers
> Not so. arriveAndDeregister is typically used by the main thread when the
> phaser acts as both a cyclic barrier and a starting latch. You create the
> phaser for N+1 threads and have all workers wait on the phaser in a loop.
> The main thread is needed to release the phaser the first time so that all
> workers have been created but thereafter is not needed so it can arrive and
> deregister.
> David Holmes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20110801/346214bf/attachment.html>

More information about the Concurrency-interest mailing list