com.bigdata.concurrent
Class LockManager<R extends Comparable<R>>

java.lang.Object
  extended by com.bigdata.concurrent.LockManager<R>

Deprecated. This implementation manages locks in terms of threads. A thread is required in order for a task to contend for its locks. This places a strain on the thread scheduler.

public class LockManager<R extends Comparable<R>>
extends Object

This class coordinates a schedule among concurrent operations requiring exclusive access to shared resources. Whenever possible, the result is a concurrent schedule - that is, operations having non-overlapping lock requirements run concurrently while operations that have lock contentions are queued behind operations that currently have locks on the relevant resources. A ResourceQueue is created for each resource and used to block operations that are awaiting a lock. When locks are not being pre-declared, a WAITS_FOR graph is additionally used to detect deadlocks.

Version:
$Id: LockManager.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
Support escalation of operation priority based on time and scheduling of higher priority operations. the latter is done by queueing lock requests in front of pending requests for each resource on which an operation attempt to gain a lock. The former is just a dynamic adjustment of the position of the operation in the resource queue where it is awaiting a lock (an operation never awaits more than one lock at a time). This facility could be used to give priority to distributed transactions over local unisolated operations and to priviledge certain operations that have low latency requirements. This is not quite a "real-time" guarentee since the VM is not (normally) providing real-time guarentees and since we are not otherwise attempting to ensure anything except lower latency when compared to other operations awaiting their own locks.

Field Summary
protected  boolean DEBUG
          Deprecated. True iff the log level is DEBUG or less.
protected  boolean INFO
          Deprecated. True iff the log level is INFO or less.
protected static org.apache.log4j.Logger log
          Deprecated.  
 
Constructor Summary
LockManager(int maxConcurrency, boolean predeclareLocks)
          Deprecated. Create a lock manager for resources and concurrent operations.
 
Method Summary
 CounterSet getCounters()
          Deprecated.  
 String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Deprecated. 

INFO

protected final boolean INFO
Deprecated. 
True iff the log level is INFO or less.


DEBUG

protected final boolean DEBUG
Deprecated. 
True iff the log level is DEBUG or less.

Constructor Detail

LockManager

public LockManager(int maxConcurrency,
                   boolean predeclareLocks)
Deprecated. 
Create a lock manager for resources and concurrent operations.

Note that there is no concurrency limit imposed by the LockManager when predeclareLocks is true as deadlocks are impossible and we do not maintain a WAITS_FOR graph.

Parameters:
maxConcurrency - The maximum multi-programming level (ignored if predeclareLocks is true).
predeclareLocks - When true operations MUST declare all locks before they begin to execute. This makes possible several efficiencies and by sorting the resources in each lock request into a common order we are able to avoid deadlocks entirely.
Method Detail

getCounters

public CounterSet getCounters()
Deprecated. 

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.