sofya.apps.atomicity
Class MultiLocksetRaceDetector

java.lang.Object
  extended by sofya.ed.semantic.EventFilter
      extended by sofya.ed.semantic.EventSelectionFilter
          extended by sofya.apps.atomicity.MultiLocksetRaceDetector
All Implemented Interfaces:
EventListener

public final class MultiLocksetRaceDetector
extends EventSelectionFilter

Implements the multi-lockset race detection algorithm for fields described by Wang and Stoller.

Version:
12/08/2005
Author:
Alex Kinneer

Nested Class Summary
 
Nested classes/interfaces inherited from interface sofya.ed.semantic.EventListener
EventListener.Arguments, EventListener.CallData, EventListener.ExceptionData, EventListener.FieldData, EventListener.MethodData, EventListener.MonitorData, EventListener.NewAllocationData, EventListener.ObjectData, EventListener.ThreadData, EventListener.ThreadStatus
 
Field Summary
 
Fields inherited from class sofya.ed.semantic.EventFilter
listenerCount, listeners
 
Constructor Summary
MultiLocksetRaceDetector(DynamicEscapeDetector escapeDetector, HappenBeforeChecker hbChecker, boolean objectSensitive)
          Creates a new multi-lockset race detector.
 
Method Summary
 void constructorEnterEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MethodData md)
          Notification that a constructor was entered.
 void instanceFieldAccessEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.FieldData fd)
          Notification that an instance field was read.
 void instanceFieldWriteEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.FieldData fd)
          Notification that an instance field was written.
 boolean isPossibleRace(int threadId, long objectId, java.lang.String fieldName, boolean isWrite)
          Tests whether a field is believed to be involved in a data race.
 void staticFieldAccessEvent(EventListener.ThreadData td, EventListener.FieldData fd)
          Notification that a static field was read.
 void staticFieldWriteEvent(EventListener.ThreadData td, EventListener.FieldData fd)
          Notification that a static field was written.
 
Methods inherited from class sofya.ed.semantic.EventSelectionFilter
callReturnEvent, classPrepareEvent, constructorCallEvent, constructorExitEvent, exceptionCatchEvent, exceptionThrowEvent, executionStarted, interfaceCallEvent, monitorAcquireEvent, monitorContendEvent, monitorPreReleaseEvent, monitorReleaseEvent, newAllocationEvent, staticCallEvent, staticInitializerEnterEvent, staticMethodEnterEvent, staticMethodExitEvent, systemExited, systemStarted, threadDeathEvent, threadStartEvent, virtualCallEvent, virtualMethodEnterEvent, virtualMethodExitEvent
 
Methods inherited from class sofya.ed.semantic.EventFilter
addEventListener, ensureCapacity, removeEventListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLocksetRaceDetector

public MultiLocksetRaceDetector(DynamicEscapeDetector escapeDetector,
                                HappenBeforeChecker hbChecker,
                                boolean objectSensitive)
Creates a new multi-lockset race detector.

Parameters:
objectSensitive - Specifies whether race detection should treat field of every object instance as distinct.
Method Detail

isPossibleRace

public boolean isPossibleRace(int threadId,
                              long objectId,
                              java.lang.String fieldName,
                              boolean isWrite)
Tests whether a field is believed to be involved in a data race.

Parameters:
threadId - ID of the thread performing the field related operation.
objectId - ID of the object that owns the field. Any negative value is permitted for static fields, but the value should be consistent.
fieldName - Fully qualified name of the field.
Returns:
true if the multi-lockset race detection believes the field is involved in a data race, false otherwise.

staticFieldAccessEvent

public void staticFieldAccessEvent(EventListener.ThreadData td,
                                   EventListener.FieldData fd)
Description copied from interface: EventListener
Notification that a static field was read.

Specified by:
staticFieldAccessEvent in interface EventListener
Overrides:
staticFieldAccessEvent in class EventSelectionFilter
Parameters:
td - Information about the thread in which the field access occurred.
fd - Information about the accessed field.

instanceFieldAccessEvent

public void instanceFieldAccessEvent(EventListener.ThreadData td,
                                     EventListener.ObjectData od,
                                     EventListener.FieldData fd)
Description copied from interface: EventListener
Notification that an instance field was read.

Specified by:
instanceFieldAccessEvent in interface EventListener
Overrides:
instanceFieldAccessEvent in class EventSelectionFilter
Parameters:
td - Information about the thread in which the field access occurred.
od - Information about the object which owns the accessed field.
fd - Information about the accessed field.

staticFieldWriteEvent

public void staticFieldWriteEvent(EventListener.ThreadData td,
                                  EventListener.FieldData fd)
Description copied from interface: EventListener
Notification that a static field was written.

Specified by:
staticFieldWriteEvent in interface EventListener
Overrides:
staticFieldWriteEvent in class EventSelectionFilter
Parameters:
td - Information about the thread in which the field write occurred.
fd - Information about the written field.

instanceFieldWriteEvent

public void instanceFieldWriteEvent(EventListener.ThreadData td,
                                    EventListener.ObjectData od,
                                    EventListener.FieldData fd)
Description copied from interface: EventListener
Notification that an instance field was written.

Specified by:
instanceFieldWriteEvent in interface EventListener
Overrides:
instanceFieldWriteEvent in class EventSelectionFilter
Parameters:
td - Information about the thread in which the field write occurred.
od - Information about the object which owns the written field.
fd - Information about the written field.

constructorEnterEvent

public void constructorEnterEvent(EventListener.ThreadData td,
                                  EventListener.ObjectData od,
                                  EventListener.MethodData md)
Description copied from interface: EventListener
Notification that a constructor was entered.

This is the first point during the object creation process at which the object can be uniquely identified.

Specified by:
constructorEnterEvent in interface EventListener
Overrides:
constructorEnterEvent in class EventSelectionFilter
Parameters:
td - Information about the thread executing the constructor.
od - Information about the object under construction. At the time of this event, only the object ID will be valid.
md - Information about the entered constructor.