org.openmdx.base.application.control
Class Rendezvous

java.lang.Object
  extended by org.openmdx.base.application.control.Rendezvous

public class Rendezvous
extends Object

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

Rendezvous

public Rendezvous()

Rendezvous

public Rendezvous(int initSize)

Rendezvous

public Rendezvous(Thread[] initMembers)
Method Detail

add

public void add()
Add the currently executing thread to the rendezvous.


remove

public void remove()
Remove the currently executing thread from the rendezvous. Note that threads must remove themselves from the rendezvous; they may not be removed by other threads.


rendezvous

public void rendezvous()
Threads should call this when they've reached their rendezvous points



This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.