Class Reader
java.lang.Object
|
+--Process
|
+--SharedDataProcess
|
+--Reader
- All Implemented Interfaces:
- java.lang.Runnable
- public class Reader
- extends SharedDataProcess
A Reader is a shared data process that reads from a shared data object.
A Reader reads from its shared data object, twiddling between reads.
The name, the average twiddle time, and the shared data object are
specified when the reader is constructed.
Constructor Summary |
Reader(java.lang.String nm,
double t,
SharedData d)
new Reader(nm, t, d) returns a new reader and starts executing
its run method in a new thread. |
Method Summary |
void |
step()
prod.step() simulates a single read step from a shared data object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Reader
public Reader(java.lang.String nm,
double t,
SharedData d)
- new Reader(nm, t, d) returns a new reader and starts executing
its run method in a new thread. The name of the new reader is
formed by concatenating its class name with nm. Its average
twiddle time is t. Its shared data object is d.
step
public void step()
- prod.step() simulates a single read step from a shared data object.
- Overrides:
step
in class Process