|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SyncData
class SyncData
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 |
---|
public LinkedList<Character> sharedMemory
public int N_memSize
public int N_eaters
public int N_givers
public Semaphore accessShared
public Semaphore fillCount
public Semaphore emptyCount
public Semaphore eaterDone
public boolean pleaseContinue
Constructor Detail |
---|
public SyncData(int memSize, int eaters, int givers)
Method Detail |
---|
public void pleaseStop()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |