edu.virginia.cs.mng.hypercast
Class DeadlockMonitor

java.lang.Object
  |
  +--edu.virginia.cs.mng.hypercast.DeadlockMonitor

class DeadlockMonitor
extends java.lang.Object
implements java.lang.Runnable

The run() method of this object checks sockets for deadlock and timeout. The thread checks all the sockets periodically. If an incoming one is not read for more than a certain time, it will creates a dropper thread to ensure progress. If a socket is idle for more than a certain time, the socket is closed.


Field Summary
private  int dropTime
          The time a socket must be ignored by its receiving thread before a message is dropped.
private  boolean dying
          True if the function die() has been called.
private  java.lang.Thread myThread
          The deadlock monitoring thread
private  TCP_UnicastAdapter Parent
          TCP_UnicastAdapter that created this object.
private  int timeoutTime
          The time a socket must be idle before being closed.
private  boolean waiting
          True if myThread is sleeping.
private  java.lang.Object waitingGuard
          A lock to ensure that myThread is only interrupted while sleeping.
 
Constructor Summary
(package private) DeadlockMonitor(TCP_UnicastAdapter adapter, int btime, int ttime)
           
 
Method Summary
 void die()
          Causes myThread to return from the run() method, effectively killing it.
 void run()
          Periodically checks all object in TCP_UnicastAdapter.incoming and TCP_UnicastAdapter.outgoings to ensure they are active and being read.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

Parent

private TCP_UnicastAdapter Parent
TCP_UnicastAdapter that created this object.

dropTime

private int dropTime
The time a socket must be ignored by its receiving thread before a message is dropped.

timeoutTime

private int timeoutTime
The time a socket must be idle before being closed.

myThread

private java.lang.Thread myThread
The deadlock monitoring thread

dying

private boolean dying
True if the function die() has been called.

waiting

private boolean waiting
True if myThread is sleeping.

waitingGuard

private java.lang.Object waitingGuard
A lock to ensure that myThread is only interrupted while sleeping.
Constructor Detail

DeadlockMonitor

DeadlockMonitor(TCP_UnicastAdapter adapter,
                int btime,
                int ttime)
Method Detail

die

public void die()
Causes myThread to return from the run() method, effectively killing it.

run

public void run()
Periodically checks all object in TCP_UnicastAdapter.incoming and TCP_UnicastAdapter.outgoings to ensure they are active and being read.
Specified by:
run in interface java.lang.Runnable