Package org.apache.tvm.rpc
Class RPCWatchdog
java.lang.Object
java.lang.Thread
org.apache.tvm.rpc.RPCWatchdog
- All Implemented Interfaces:
Runnable
Watchdog for RPC.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Finish a timeout with watchdog (must be called after startTimeout).void
run()
Wait and kill RPC if timeout is exceeded.void
startTimeout
(int timeout) Start a timeout with watchdog (must be called before finishTimeout).protected void
Default method to terminate the running RPCActivity process.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
RPCWatchdog
public RPCWatchdog()
-
-
Method Details
-
startTimeout
public void startTimeout(int timeout) Start a timeout with watchdog (must be called before finishTimeout).- Parameters:
timeout
- watchdog timeout in ms.
-
finishTimeout
public void finishTimeout()Finish a timeout with watchdog (must be called after startTimeout). -
run
public void run()Wait and kill RPC if timeout is exceeded. -
terminate
protected void terminate()Default method to terminate the running RPCActivity process.
-