Class SyncData

java.lang.Object
  extended by SyncData

 class SyncData
extends Object

Contains synchronization data.


Field Summary
 Semaphore accessShared
          Only one task can use the shared memory buffer at a time.
 Semaphore eaterDone
          Semaphore released when a consumer decides to stop consuming.
 Semaphore emptyCount
          This semaphore is increased when a letter is consumed.
 Semaphore fillCount
          This semaphore is increased when a new letter is produced.
 int N_eaters
          Number of vowel eaters.
 int N_givers
          Number of vowel producers.
 int N_memSize
          Size of the shared memory buffer.
 boolean pleaseContinue
          Flag to stop producers.
 LinkedList<Character> sharedMemory
           
 
Constructor Summary
SyncData(int memSize, int eaters, int givers)
          Constructor.
 
Method Summary
 void pleaseStop()
          Ask producers to stop producing vowels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sharedMemory

public LinkedList<Character> sharedMemory

N_memSize

public int N_memSize
Size of the shared memory buffer.


N_eaters

public int N_eaters
Number of vowel eaters.


N_givers

public int N_givers
Number of vowel producers.


accessShared

public Semaphore accessShared
Only one task can use the shared memory buffer at a time.


fillCount

public Semaphore fillCount
This semaphore is increased when a new letter is produced.


emptyCount

public Semaphore emptyCount
This semaphore is increased when a letter is consumed.


eaterDone

public Semaphore eaterDone
Semaphore released when a consumer decides to stop consuming.


pleaseContinue

public boolean pleaseContinue
Flag to stop producers.

Constructor Detail

SyncData

public SyncData(int memSize,
                int eaters,
                int givers)
Constructor.

Method Detail

pleaseStop

public void pleaseStop()
Ask producers to stop producing vowels.