orc.runtime.regions
Class LogicalClock

java.lang.Object
  extended by orc.runtime.regions.Region
      extended by orc.runtime.regions.SubRegion
          extended by orc.runtime.regions.LogicalClock

public final class LogicalClock
extends SubRegion

An event queue for site calls to a logical timer (created by MakeTimer).

According to the semantics of logical time, logical timers can only advance when there are no pending site calls except those to so-called "immediate" sites. However it's not so clear how logical timers should interact with "<<". For the moment clocks are allowed to advance even if there are tokens blocked on a group cell.

Author:
dkitchin, quark

Field Summary
 
Fields inherited from class orc.runtime.regions.SubRegion
parent
 
Constructor Summary
LogicalClock(Region parent, LogicalClock parentClock)
           
 
Method Summary
 void addEvent(int delay, Token token)
          Schedule a token to resume at a future time.
 int getCurrentTime()
           
 LogicalClock getParentClock()
           
protected  void maybeDeactivate()
          Advance the logical time.
 
Methods inherited from class orc.runtime.regions.SubRegion
activate, deactivate, getParent, onClose
 
Methods inherited from class orc.runtime.regions.Region
add, add, addActive, close, putContainedTokens, remove, remove, removeActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalClock

public LogicalClock(Region parent,
                    LogicalClock parentClock)
Method Detail

addEvent

public final void addEvent(int delay,
                           Token token)
Schedule a token to resume at a future time.


maybeDeactivate

protected void maybeDeactivate()
Advance the logical time. Called when all child tokens and clocks are quiescent.

Overrides:
maybeDeactivate in class Region

getParentClock

public LogicalClock getParentClock()
                            throws SiteException
Throws:
SiteException

getCurrentTime

public int getCurrentTime()