|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpsimjava.Waitq
public class Waitq
PsimJ Java Object-oriented simulation package, process interaction approach. (C) Jose M. Garrido, June 2000, August 2003, 2004, 2007 Class Waitq manipulates the cooperation of processes.
It allows for one of the processes (master) to dominate and the other to be treated as a slave process, held in the slave queue during the period of cooperation. Objects of this class are used as a synchronization mechanism. The queues are constructed by priorities.
| Constructor Summary | |
|---|---|
Waitq(java.lang.String name,
int maxprio)
Initializes a Waitq object with its mane and the maximum priority to use |
|
| Method Summary | |
|---|---|
Process |
coopt()
This function returns a slave process from the slave queue. |
int |
length()
Returns the length (number of processes) in the slave queue |
int |
lengthm()
Returns the length (number of processes) in the master queue |
void |
qwait()
Places current process in the slave queue and passivates (suspends) waiting for a process in the master queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Waitq(java.lang.String name,
int maxprio)
name - title for the object createdmaxprio - maximum priority to use| Method Detail |
|---|
public int length()
public int lengthm()
public void qwait()
public Process coopt()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||