edu.udo.cs.miningmart.compiler
Class CompilerThreadControl

java.lang.Object
  extended byedu.udo.cs.miningmart.compiler.CompilerThreadControl

public class CompilerThreadControl
extends java.lang.Object

This class is used in CompilerAccessLogic in order to avoid database deadlocks when garbage collection and single step compilation threads are mixed. Current strategy:

Version:
$Id: CompilerThreadControl.java,v 1.4 2006/04/11 14:10:09 euler Exp $
Author:
Martin Scholz

Field Summary
static short GARBAGE_COLLECTION
          constant for state "resource is occupied by garbage collection"
static short RESOURCE_FREE
          constant for state "resource is free"
static short STEP_COMPILATION
          constant for state "resource is occupied by the single step compiler"
 
Constructor Summary
CompilerThreadControl()
           
 
Method Summary
 void addThread(short type)
          This method registers a thread before execution, in order to regulate concurrent access to resources.
 void subThread(short type)
          This method unregisters a thread of a specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_FREE

public static final short RESOURCE_FREE
constant for state "resource is free"

See Also:
Constant Field Values

GARBAGE_COLLECTION

public static final short GARBAGE_COLLECTION
constant for state "resource is occupied by garbage collection"

See Also:
Constant Field Values

STEP_COMPILATION

public static final short STEP_COMPILATION
constant for state "resource is occupied by the single step compiler"

See Also:
Constant Field Values
Constructor Detail

CompilerThreadControl

public CompilerThreadControl()
Method Detail

addThread

public void addThread(short type)
               throws M4CompilerError
This method registers a thread before execution, in order to regulate concurrent access to resources. If the resource is not free, the method waits until the thread may continue.

Parameters:
type - One of the constants (public static fields) of this class, representing different types of threads.
Throws:
M4CompilerError

subThread

public void subThread(short type)
               throws M4CompilerError
This method unregisters a thread of a specified type. It must be called exactly for those threads registered via addThread(short) after the critical resource is no longer accessed.

Parameters:
type - One of the constants (public static fields) of this class, representing different types of threads.
Throws:
M4CompilerError


Copyright © 2001-2005