org.edg.info
Class QueueManager

java.lang.Object
  extended byorg.edg.info.QueueManager

public class QueueManager
extends java.lang.Object

Contains a queue that holds all the tuples the Consumer has obtained from its Producers. Note, name coincides with Consumer API which makes use of various pop() routines to extract tuples. In practice, this is still a buffer (using a FIFO structure).

XXX-AC: synchronization deserves some explanation! There will be quite a few blockingPush threads trying to populate the queue, and a consumerInstance thread with blockingPops trying to clear the queue.

If the buffer is found to be full, then the blockingPush threads will be paused. If a tuple is popped, then one of these will be able to grab the monitor, and dump it's tuples.

Conversly, if the buffer empties, then the blockingPop thread will pause. If a tuple is added, then it grabs the monitor and continues.

These two situations explore different scenarios, and so therefore it isn't possible (I hope!) for there to be a blockingPop thread and a blockingPush to both be waiting for the monitor.


Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait