|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.base.application.control.Rendezvous
public class Rendezvous
The rendezvous mechanism is implemented as a single class, and provides a set of functions useful for a wide range of applications. In short, it allows one to synchronize an arbitrary number of concurrent threads very easily. To use the rendezvous class, the methods used are add(), remove(), and rendezvous(). First, a new rendezvous object and the new thread objects to be synchronized are created. Then, the threads are placed in the rendezvous, using the add() method, usually before the new threads are started. Within the body of each thread, the rendezvous() method of the rendezvous object is called. This causes that thread to block until all threads in that particular rendezvous have called rendezvous(). When all threads reach their rendezvous points, all the threads in the rendezvous resume execution. Additionally, at any point during its execution, a thread may elect to remove itself or another thread from the rendezvous. This feature supports the capability to implement conditional synchronization, which can be useful in many applications. Also, several rendezvous objects may exist within a program at once, and a single thread may participate in many rendezvous. This allows many different "clocks" to coexist within the program, and is also quite powerful in allowing a wide range of expression of behaviors. Taken together, the capabilities of the rendezvous class make it ideal for use in applications where inter-thread interaction is rich and complex, and where determinate behavior is desired.
| Constructor Summary | |
|---|---|
Rendezvous()
|
|
Rendezvous(int initSize)
|
|
Rendezvous(Thread[] initMembers)
|
|
| Method Summary | |
|---|---|
void |
add()
Add the currently executing thread to the rendezvous. |
void |
remove()
Remove the currently executing thread from the rendezvous. |
void |
rendezvous()
Threads should call this when they've reached their rendezvous points |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rendezvous()
public Rendezvous(int initSize)
public Rendezvous(Thread[] initMembers)
| Method Detail |
|---|
public void add()
public void remove()
public void rendezvous()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||