[concurrency-interest] EDU.oswego.cs.dl.util.concurrent.Latch and Sync replace with java.util.concurrent.locks.AbstractQueuedSynchronizer

Vitaly Davidovich vitalyd at gmail.com
Fri Feb 10 15:22:40 EST 2012


You can replace it with j.u.c.CountdownLatch (with a count of 1 for a
one-time signal).

Sent from my phone
On Feb 10, 2012 3:17 PM, "Aleksandar Lazic" <
al-javaconcurrencyinterest at none.at> wrote:

> Dear list members,
>
> currently I read the book
>
> Concurrent Programming in Java: Design Principles and Patterns, (second
> edition)
>
> and try to use the
>
> abstract class DiskTask implements Runnable {
> ....
> }
>
> but there is the following line
>
> protected final Latch done = new Latch(); // status indicator
>
> After a little search I have found
>
> http://gee.cs.oswego.edu/dl/**classes/EDU/oswego/cs/dl/util/**
> concurrent/intro.html<http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html>
>
> with Sync and Latch but this classes are outdated.
>
> Can I replace the class Latch with AbstractQueuedSynchronizer or is there
> a better replacement?
>
> Thanks for your help
>
> Aleks
> ______________________________**_________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
> http://cs.oswego.edu/mailman/**listinfo/concurrency-interest<http://cs.oswego.edu/mailman/listinfo/concurrency-interest>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120210/7f74f61c/attachment.html>


More information about the Concurrency-interest mailing list