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

Aleksandar Lazic al-javaconcurrencyinterest at none.at
Fri Feb 10 15:15:49 EST 2012


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

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


More information about the Concurrency-interest mailing list