|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.cunit.SyncPointBuffer
public class SyncPointBuffer
Class that records synchronization points. NOTE: This class may not be instrumented with a strategy affecting synchronized methods or blocks! Do not instrument with SynchronizedMethodToBlockStrategy, SynchronizedBlockStrategy, CompactSynchronizedBlockStrategy, CompactSynchronizedBlockDebugStrategy, or CompactSynchronizedBlockReplayStrategy.
Nested Class Summary | |
---|---|
static class |
SyncPointBuffer.SP
Enumeration of sync point codes. |
Field Summary | |
---|---|
private static int |
_compactIndex
Index to be used next for the compact array. |
private static long[] |
_compactSyncPoints
Compact array of synchronization points. |
private static long[] |
_immediateTransfer
Array for immediate transfer. |
private static int |
_index
Index to be used next. |
static java.lang.String |
_message
Message description. |
private static java.lang.Object |
_newBufferWaitObj
Object that threads can wait for if they need to wait for a new buffer. |
static long |
_nextObjectID
Next object ID to be assigned. |
static long |
_nextThreadID
Next thread ID to be assigned. |
private static boolean |
_recording
True if points should be recorded. |
private static boolean |
_replayBufferLoaded
True if the initial buffer for replay has been loaded. |
private static int |
_replayIndex
Index to be used next for the replay array. |
private static boolean |
_replaying
True if scheduled replay has begun. |
private static long[] |
_replaySyncPoints
Record array of synchronization points. |
private static java.lang.Object[] |
_replayWaitArray
Object array with objects that threads may wait for. |
private static int |
_replayWaitIndex
Index to be used next for the replay wait array. |
static long |
_runningThreads
Number of running threads. |
private static ISyncPoint[] |
_syncPoints
Array of synchronization points. |
private static boolean |
_transferImmediately
True if points should be recorded immediately. |
private static java.lang.Object |
_waitAlgoObj
Object that threads can wait for if they need to enter the algorithm. |
static int |
COMPACT_DEBUG_RECORD_SIZE
Size of a record in the compact array with debug info. |
static int |
COMPACT_RECORD_SIZE
Size of a record in the compact array. |
static int |
COMPACT_SIZE
Size of compact array. |
static int |
RANDOM_DELAY_MAGNITUDE
Length of time in milliseconds between the shorted and the longest delay. |
static int |
RANDOM_DELAY_MIN
Length of the shortest delay in milliseconds. |
static boolean |
RANDOM_DELAY_POST_MONITOR
Enable delay after monitorenter/exit? |
static boolean |
RANDOM_DELAY_POST_NOTIFY
Enable delay after notify? |
static boolean |
RANDOM_DELAY_POST_WAIT
Enable delay after wait? |
static boolean |
RANDOM_DELAY_PRE_MONITOR
Enable delay before monitorenter/exit?? |
static boolean |
RANDOM_DELAY_PRE_NOTIFY
Enable delay before notify? |
static boolean |
RANDOM_DELAY_PRE_WAIT
Enable delay before wait? |
static boolean |
RANDOM_DELAY_THREAD_EXIT
Enable delay on thread exit? |
static boolean |
RANDOM_DELAY_THREAD_JOIN
Enable delay on thread join? |
static boolean |
RANDOM_DELAY_THREAD_RUN
Enable delay on thread run? |
static boolean |
RANDOM_DELAY_THREAD_START
Enable delay on thread start? |
static boolean |
RANDOM_YIELD_POST_MONITOR
Enable yield after monitorenter/exit? |
static boolean |
RANDOM_YIELD_POST_NOTIFY
Enable yield after notify? |
static boolean |
RANDOM_YIELD_POST_WAIT
Enable yield after wait? |
static boolean |
RANDOM_YIELD_PRE_MONITOR
Enable yield before monitorenter/exit?? |
static boolean |
RANDOM_YIELD_PRE_NOTIFY
Enable yield before notify? |
static boolean |
RANDOM_YIELD_PRE_WAIT
Enable yield before wait? |
static float |
RANDOM_YIELD_PROB
Probability of a yield. |
static boolean |
RANDOM_YIELD_THREAD_EXIT
Enable yield on thread exit? |
static boolean |
RANDOM_YIELD_THREAD_JOIN
Enable yield on thread join? |
static boolean |
RANDOM_YIELD_THREAD_RUN
Enable yield on thread run? |
static boolean |
RANDOM_YIELD_THREAD_START
Enable yield on thread start? |
static int |
REPLAY_SIZE
Size of replay array. |
static int |
SIZE
Size of array. |
Constructor Summary | |
---|---|
SyncPointBuffer()
|
Method Summary | |
---|---|
static java.lang.Class<?> |
_class()
A method to retrieve the .class field; this is required for pre-1.5 compatibility where simple field access to the .class field is not allowed. |
static void |
add(ISyncPoint sp)
Adds a synchronization point to the list. |
static void |
compactAdd(long code,
long tid)
Adds a synchronization point to the compact list. |
static void |
compactDebugAdd(long oid,
long code,
long tid,
long classIndex,
long methodAndPC)
Adds a synchronization point to the compact list. |
static void |
compactImmediateTransfer()
Transfer immediately and empty compact array. |
static void |
compactThreadExit(long tid)
Notify the wait algorithm that a thread has ended and check if the next thread has to be woken up. |
static void |
compactThreadExit(long tid,
long classIndex,
long methodAndPC)
Notify the wait algorithm that a thread has ended and check if the next thread has to be woken up. |
static void |
compactTransfer()
Transfer and empty compact array. |
static void |
compactWait(long code,
long tid)
Wait for this synchronization point in the compact list. |
static void |
compactWait(long code,
long tid,
long classIndex,
long methodAndPC)
Wait for this synchronization point in the compact list. |
static void |
delayObjectWait(boolean delay)
Throw an exception if no other thread is alive anymore, otherwise sleep for a while. |
static void |
delayThreadExit(boolean delay)
Sleep for a while if there is concurrency, and then decrement the number of running threads. |
static void |
delayThreadStart(boolean delay)
Increment the number of running thread, and then sleep for a while if there is concurrency. |
static boolean |
isOldThread()
Marker for getting the value of the $$$oldThread$$$ field. |
static boolean |
isRecording()
Accessor for the recording flag. |
static void |
monitorEnter(java.lang.Object o)
Marker for monitorenter instructions. |
static void |
monitorExit(java.lang.Object o)
Marker for monitorexit instructions. |
static void |
randomDelay(boolean delay)
Sleep for a random amount of time, up to RANDOM_DELAY_MAGNITUDE milliseconds, if there is concurrency. |
static void |
randomYield(boolean yield)
Yield if random number < RANDOM_YIELD_PROB, but only if there is concurrency. |
static void |
replayTransfer()
Transfer and and reset replay array. |
static void |
setMessage(java.lang.String message)
Notify the monitor application of a message. |
static void |
setOldThread()
Marker for setting $$$oldThread$$$ field. |
static void |
setRecording(boolean recording)
Mutator for the recording flag. |
static void |
transfer()
Transfer and empty array. |
static void |
yieldObjectWait(boolean yield)
Throw an exception if no other thread is alive anymore, otherwise do a random yield. |
static void |
yieldThreadExit(boolean yield)
Do a random yield, and then decrement the number of running threads. |
static void |
yieldThreadStart(boolean yield)
Increment the number of running thread, and then do a random yield. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SIZE
private static volatile ISyncPoint[] _syncPoints
private static volatile int _index
public static final int COMPACT_RECORD_SIZE
public static final int COMPACT_DEBUG_RECORD_SIZE
public static final int COMPACT_SIZE
private static volatile long[] _compactSyncPoints
private static volatile int _compactIndex
public static final int REPLAY_SIZE
private static volatile long[] _replaySyncPoints
private static volatile java.lang.Object[] _replayWaitArray
private static final java.lang.Object _waitAlgoObj
private static final java.lang.Object _newBufferWaitObj
private static volatile int _replayIndex
private static volatile int _replayWaitIndex
private static volatile boolean _recording
private static volatile boolean _transferImmediately
private static volatile long[] _immediateTransfer
private static volatile boolean _replaying
private static volatile boolean _replayBufferLoaded
public static volatile long _nextObjectID
public static volatile long _nextThreadID
public static volatile java.lang.String _message
public static volatile long _runningThreads
public static final int RANDOM_DELAY_MIN
public static final int RANDOM_DELAY_MAGNITUDE
public static boolean RANDOM_DELAY_THREAD_START
public static boolean RANDOM_DELAY_THREAD_EXIT
public static boolean RANDOM_DELAY_THREAD_RUN
public static boolean RANDOM_DELAY_THREAD_JOIN
public static boolean RANDOM_DELAY_PRE_NOTIFY
public static boolean RANDOM_DELAY_POST_NOTIFY
public static boolean RANDOM_DELAY_PRE_WAIT
public static boolean RANDOM_DELAY_POST_WAIT
public static boolean RANDOM_DELAY_PRE_MONITOR
public static boolean RANDOM_DELAY_POST_MONITOR
public static float RANDOM_YIELD_PROB
public static boolean RANDOM_YIELD_THREAD_START
public static boolean RANDOM_YIELD_THREAD_EXIT
public static boolean RANDOM_YIELD_THREAD_RUN
public static boolean RANDOM_YIELD_THREAD_JOIN
public static boolean RANDOM_YIELD_PRE_NOTIFY
public static boolean RANDOM_YIELD_POST_NOTIFY
public static boolean RANDOM_YIELD_PRE_WAIT
public static boolean RANDOM_YIELD_POST_WAIT
public static boolean RANDOM_YIELD_PRE_MONITOR
public static boolean RANDOM_YIELD_POST_MONITOR
Constructor Detail |
---|
public SyncPointBuffer()
Method Detail |
---|
public static final java.lang.Class<?> _class()
public static void add(ISyncPoint sp)
sp
- synchronization point to add.public static void transfer()
public static void compactAdd(long code, long tid)
code
- code for this eventtid
- thread idpublic static void compactDebugAdd(long oid, long code, long tid, long classIndex, long methodAndPC)
oid
- object idcode
- code for this eventtid
- thread idclassIndex
- index of the class in the method databasemethodAndPC
- method index and PCpublic static void compactTransfer()
public static void compactImmediateTransfer()
public static void compactWait(long code, long tid)
code
- code for this eventtid
- thread idpublic static void compactThreadExit(long tid)
tid
- thread idpublic static void compactWait(long code, long tid, long classIndex, long methodAndPC)
code
- code for this eventtid
- thread idclassIndex
- index of the class in the method databasemethodAndPC
- method index and PCpublic static void compactThreadExit(long tid, long classIndex, long methodAndPC)
tid
- thread idclassIndex
- index of the class in the method databasemethodAndPC
- method index and PCpublic static void replayTransfer()
public static boolean isRecording()
public static void setRecording(boolean recording)
recording
- true if recording should be enabledpublic static void setMessage(java.lang.String message)
message
- message stringpublic static void monitorEnter(java.lang.Object o)
o
- object whose lock should be acquiredpublic static void monitorExit(java.lang.Object o)
o
- object whose lock should be releasedpublic static boolean isOldThread()
public static void setOldThread()
public static void randomDelay(boolean delay)
delay
- true if delay is enabledpublic static void delayThreadStart(boolean delay)
delay
- true if delay is enabledpublic static void delayThreadExit(boolean delay)
delay
- true if delay is enabledpublic static void delayObjectWait(boolean delay)
delay
- true if delay is enabledpublic static void randomYield(boolean yield)
yield
- true if yield is enabledpublic static void yieldThreadStart(boolean yield)
yield
- true if yield is enabledpublic static void yieldThreadExit(boolean yield)
yield
- true if yield is enabledpublic static void yieldObjectWait(boolean yield)
yield
- true if yield is enabled
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |