Three implementations of safe, concurrent producer-consumer queues.
- Complete the implementation of
OneLockConcurrentQueue
that uses only a single, shared lock. - Test your implementation of
OneLockConcurrentQueue
by usingConcurrentQueueTest
in the repository. - Complete the implementation of
TwoLockConcurrentQueue
which implements theConcurrentQueue
interface and which supports fine-grained locking by locking on the first and lastLink
items in the queue as suggested in the paper [1]. - Complete the implementation of
NoLockConcurrentQueue
which implements theConcurrentQueue
interface and which uses no locks by making use of theAtomicReference
class injava.util.concurrent.atomic
. - Test your implementation of
TwoLockConcurrentQueue
andNoLockConcurrentQueue
by usingConcurrentQueueTest
.
[1] Maged M. Michael, Michael L. Scott (1996) Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms