edu.vt.marian.common
Class ReaderWriterMutex

java.lang.Object
  |
  +--edu.vt.marian.common.ReaderWriterMutex

public class ReaderWriterMutex
extends java.lang.Object

This class provides a moniter object for thread coordination. It supports multiple readers/single writer mode. uses the services of class(es): ReaderWriterMutex(Debug debug) ReaderWriterMutex(int reader_limit, Debug debug) void read_enter() void read_exit() void writer_enter() void writer_exit() int get_max_active_reader_number() int set_max_active_reader_number(int reader_limit) designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Pingang Wang (pwang@csgrad.cs.vt.edu) finished time: 11/23/98 known bugs: None JDK version: JDK 1.1.5 side effects: Unknown


Constructor Summary
ReaderWriterMutex(Debug debug)
          method name: ReaderWriterMutex method description: constructor of ReaderWriterMutex class uses the services of class(es): input parameter(s): Debug - debug object output parameter(s): none return value: none synchronization consideration:
ReaderWriterMutex(int reader_limit, Debug debug)
          method name: ReaderWriterMutex method description: constructor of ReaderWriterMutex class uses the services of class(es): input parameter(s): int reader_limit - cocurrent reader limit Debug debug - debug object output parameter(s): none return value: none synchronization consideration:
 
Method Summary
 int get_max_active_reader_number()
          method name: get_max_active_reader_number method description: Return the limit of active readers.
 void reader_enter()
          method name: reader_enter method description: This method is called when a reader enters the critical section.
 void reader_exit()
          method name: reader_exit method description: This method is called when a reader exits the critical section.
 int set_max_active_reader_number(int reader_limit)
          method name: get_max_active_reader_number method description: Set the limit of active readers.
 void writer_enter()
          method name: writer_enter method description: This method is called when a writer enters the critical section.
 void writer_exit()
          method name: writer_exit method description: This method is called when a writer exits the critical section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReaderWriterMutex

public ReaderWriterMutex(Debug debug)
method name: ReaderWriterMutex method description: constructor of ReaderWriterMutex class uses the services of class(es): input parameter(s): Debug - debug object output parameter(s): none return value: none synchronization consideration:

ReaderWriterMutex

public ReaderWriterMutex(int reader_limit,
                         Debug debug)
method name: ReaderWriterMutex method description: constructor of ReaderWriterMutex class uses the services of class(es): input parameter(s): int reader_limit - cocurrent reader limit Debug debug - debug object output parameter(s): none return value: none synchronization consideration:
Method Detail

reader_enter

public void reader_enter()
method name: reader_enter method description: This method is called when a reader enters the critical section. uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration:

reader_exit

public void reader_exit()
method name: reader_exit method description: This method is called when a reader exits the critical section. uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration:

writer_enter

public void writer_enter()
method name: writer_enter method description: This method is called when a writer enters the critical section. uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration:

writer_exit

public void writer_exit()
method name: writer_exit method description: This method is called when a writer exits the critical section. uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration:

get_max_active_reader_number

public int get_max_active_reader_number()
method name: get_max_active_reader_number method description: Return the limit of active readers. uses the services of class(es): input parameter(s): none output parameter(s): none return value: limit of active readers synchronization consideration:

set_max_active_reader_number

public int set_max_active_reader_number(int reader_limit)
method name: get_max_active_reader_number method description: Set the limit of active readers. uses the services of class(es): input parameter(s): int reader_limit - active reader limit output parameter(s): none return value: none synchronization consideration: