cz.vutbr.fit.racedetector
Class NoiseInjection

java.lang.Object
  extended by cz.vutbr.fit.racedetector.NoiseInjection

public class NoiseInjection
extends java.lang.Object

This class implements the noise injection based on ConTest util.Noise class. The noise is injected into places within atomic sections with intention to increase the probability of data race manifestation.

Copied from the ConTest JavaDoc of util.Noise class: Instruct the user to set the frequency parameter to zero (the strength, noise type and halt-one-thread parameters would still be consulted by the methods of this class). Similarly the user should be instructed to disable other extensions that do noise.

Author:
zdenek

Field Summary
static boolean DEBUG
           
 
Constructor Summary
NoiseInjection(int frequency)
           
 
Method Summary
static int getLocationsFromFile(java.io.BufferedReader fd)
          Takes each line from the input file and tries if the line contains valid program location.
static void progLocInjectNoise(java.lang.String progLocation)
          Inserts with predefined probability the noise with predefined strength to the thread which calls this method if a variable is specified.
static void randInjectNoise()
          Inserts with predefined probability the noise with predefined strength to the thread which calls this method if a variable is specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

NoiseInjection

public NoiseInjection(int frequency)
Method Detail

randInjectNoise

public static void randInjectNoise()
Inserts with predefined probability the noise with predefined strength to the thread which calls this method if a variable is specified.


progLocInjectNoise

public static void progLocInjectNoise(java.lang.String progLocation)
Inserts with predefined probability the noise with predefined strength to the thread which calls this method if a variable is specified.


getLocationsFromFile

public static int getLocationsFromFile(java.io.BufferedReader fd)
Takes each line from the input file and tries if the line contains valid program location. If so the string is interned and puts to the set of locations that will be focused by the noise.

Parameters:
fd - Given file to read from.
Returns:
Count of valid program locations read from the given file