Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.udo.cs.miningmart.compiler
Class CompilerThreadControl

    java.lang.Object
      edu.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:

- Compiling steps in parallel is allowed.
- A garbage collection thread runs on its own.
- Update statistic threads are considered compilation steps.
- Status message threads are not synchronized at all.

Version:
  $Id: CompilerThreadControl.java,v 1.5 2006/09/27 14:59:54 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005