Class BoundedBufferProcess

java.lang.Object
  |
  +--Process
        |
        +--BoundedBufferProcess
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Consumer, Producer

public abstract class BoundedBufferProcess
extends Process

A BoundedBufferProcess is a process that works with two buffer queues, one with empty buffers and one with full buffers. The buffer queues are specified in the class constructor.

This class is abstract. Concrete subclasses must implement the step() method.


Field Summary
protected  BufferQueue empty
          empty is the queue for empty buffers used by this bounded buffer process.
protected  BufferQueue full
          full is the queue for full buffers used by this bounded buffer process.
 
Constructor Summary
BoundedBufferProcess(java.lang.String nm, double t, BufferQueue f, BufferQueue e)
          new BoundedBufferProcess(nm, t, f, e) returns a new bounded buffer process and starts executing its run method in a new thread.
 
Methods inherited from class Process
run, setSimulationTime, step, toString, twiddle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

empty

protected BufferQueue empty
empty is the queue for empty buffers used by this bounded buffer process.

full

protected BufferQueue full
full is the queue for full buffers used by this bounded buffer process.
Constructor Detail

BoundedBufferProcess

public BoundedBufferProcess(java.lang.String nm,
                            double t,
                            BufferQueue f,
                            BufferQueue e)
new BoundedBufferProcess(nm, t, f, e) returns a new bounded buffer process and starts executing its run method in a new thread. The name of the new process is formed by concatenating its class name with nm. The average twiddle time of the new process is t. The new process uses f as a queue for full buffers and e as a queue for empty buffers.