edu.wis.jtlv.env
Class JTLVThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.wis.jtlv.env.JTLVThread
All Implemented Interfaces:
java.lang.Runnable

public abstract class JTLVThread
extends java.lang.Thread

JTLVThread is a thread dedicated to BDD operations. The BDD packages them selves are not implemented to support multi threading. This current implementation is very restrictive. The user must be completely aware to the implementation, and avoid the following issue.

Main thread has a BDD manager of its own. In addition, each instance of a JTLV thread has a completely disjoint dedicated BDD manager in JTLV environment. You can get the thread dedicated manager index by using getDedicatedBDDManagerIdx().
Performing operation between two BDD, created from different BDD manager will lead to and error. The only way to port BDDs from one manager to another is by using adjustBDD* procedure given in this implementation. Porting is a BDD action, be also careful with multi threading porting.
e.g. don't do adjustBDDToBase in two concurrent threads since both are writing to the same base manager.

The number managers must be declared up-front before doing anything in "Env" (or before reseting the environment). The number of managers is declared by the System.property key "pool_size" (plus one additional manager to the main thread).
Be aware that instantiating and assigning more JTLVThread then the number of managers, will lock the last thread until a manager will be freed. (e.g. might lead to a deadlock.)

Version:
"1.3.2"
Author:
yaniv sa'ar.
See Also:
Env.getThreadPoolSize(), Env.assignDedicatedBDDManagerIdx(JTLVThread)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 BDD adjustBDDToBase(BDD to_adjust)
           Copy the BDD from this manager to the base manager.
 BDD[] adjustBDDToBase(BDD[] to_adjust)
           Copy an array of BDDs from this manager to the base manager.
 BDD adjustBDDToManager(BDD to_adjust)
           Copy the BDD to the manager assigned to this thread.
 BDD[] adjustBDDToManager(BDD[] to_adjust)
           Copy an array of BDDs to the manager assigned to this thread.
 BDDVarSet adjustBDDVarSetToBase(BDDVarSet to_adjust)
           Copy the BDDVarSet from this manager to the base manager.
 BDDVarSet[] adjustBDDVarSetToBase(BDDVarSet[] to_adjust)
           Copy an array of BDDVarSets from this manager to the base manager.
 BDDVarSet adjustBDDVarSetToManager(BDDVarSet to_adjust)
           Copy the BDDVarSet to the manager assigned to this thread.
 BDDVarSet[] adjustBDDVarSetToManager(BDDVarSet[] to_adjust)
           Copy an array of BDDVarSets to the manager assigned to this thread.
 long getCopyTime()
           Get the accumulated overall time (since last reset) of copy to this BDD factory.
 int getDedicatedBDDManagerIdx()
           
 boolean isMonitoringCopyTime()
           
 void resetCopyTime()
           Reset the time this thread spent on copying.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDedicatedBDDManagerIdx

public int getDedicatedBDDManagerIdx()

isMonitoringCopyTime

public boolean isMonitoringCopyTime()

resetCopyTime

public void resetCopyTime()

Reset the time this thread spent on copying.

See Also:
getCopyTime()

getCopyTime

public long getCopyTime()

Get the accumulated overall time (since last reset) of copy to this BDD factory.

Returns:
The time it took to copy BDD's into this BDD factory.
See Also:
resetCopyTime()

adjustBDDToManager

public BDD adjustBDDToManager(BDD to_adjust)

Copy the BDD to the manager assigned to this thread.

Parameters:
to_adjust - The BDD to copy.
Returns:
The copied BDD in the manager assigned to this thread.
See Also:
adjustBDDToBase(BDD), adjustBDDToBase(BDD[]), adjustBDDToManager(BDD[])

adjustBDDToManager

public BDD[] adjustBDDToManager(BDD[] to_adjust)

Copy an array of BDDs to the manager assigned to this thread.

Parameters:
to_adjust - The array of BDD's to copy.
Returns:
An array with the copied BDD in the manager assigned to this thread.
See Also:
adjustBDDToBase(BDD), adjustBDDToBase(BDD[]), adjustBDDToManager(BDD)

adjustBDDToBase

public BDD adjustBDDToBase(BDD to_adjust)

Copy the BDD from this manager to the base manager.

Parameters:
to_adjust - The BDD to copy.
Returns:
The copied BDD in the Base manager.
See Also:
adjustBDDToBase(BDD[]), adjustBDDToManager(BDD), adjustBDDToManager(BDD[])

adjustBDDToBase

public BDD[] adjustBDDToBase(BDD[] to_adjust)

Copy an array of BDDs from this manager to the base manager.

Parameters:
to_adjust - The array of BDD's to copy.
Returns:
An array with the copied BDD in the Base manager.
See Also:
adjustBDDToBase(BDD), adjustBDDToManager(BDD), adjustBDDToManager(BDD[])

adjustBDDVarSetToManager

public BDDVarSet adjustBDDVarSetToManager(BDDVarSet to_adjust)

Copy the BDDVarSet to the manager assigned to this thread.

Parameters:
to_adjust - The BDDVarSet to copy.
Returns:
The copied BDDVarSet in the manager assigned to this thread.
See Also:
adjustBDDVarSetToBase(BDDVarSet), adjustBDDVarSetToBase(BDDVarSet[]), adjustBDDVarSetToManager(BDDVarSet[])

adjustBDDVarSetToManager

public BDDVarSet[] adjustBDDVarSetToManager(BDDVarSet[] to_adjust)

Copy an array of BDDVarSets to the manager assigned to this thread.

Parameters:
to_adjust - The array of BDDVarSet's to copy.
Returns:
An array with the copied BDDVarSet in the manager assigned to this thread.
See Also:
adjustBDDVarSetToBase(BDDVarSet), adjustBDDVarSetToBase(BDDVarSet[]), adjustBDDVarSetToManager(BDDVarSet)

adjustBDDVarSetToBase

public BDDVarSet adjustBDDVarSetToBase(BDDVarSet to_adjust)

Copy the BDDVarSet from this manager to the base manager.

Parameters:
to_adjust - The BDDVarSet to copy.
Returns:
The copied BDDVarSet in the Base manager.
See Also:
adjustBDDVarSetToBase(BDDVarSet[]), adjustBDDVarSetToManager(BDDVarSet), adjustBDDVarSetToManager(BDDVarSet[])

adjustBDDVarSetToBase

public BDDVarSet[] adjustBDDVarSetToBase(BDDVarSet[] to_adjust)

Copy an array of BDDVarSets from this manager to the base manager.

Parameters:
to_adjust - The array of BDDVarSet's to copy.
Returns:
An array with the copied BDDVarSet in the Base manager.
See Also:
adjustBDDVarSetToBase(BDDVarSet), adjustBDDVarSetToManager(BDDVarSet), adjustBDDVarSetToManager(BDDVarSet[])