www.antiaction.com / java / critical
Semaphores for use where tight resource control is needed.
Version:
1.00
License:
This package is distributed under the Free software Foundation's (FSF)
General Public License (GPL).
Download:
critical.jar
critical-docs.tar.gz
overview-summary.html
Overview:
Semaphores are an extension of the java synchronization framework. In actuallíty the classes are wrapped around some datastructures and synchronized methods.
The main purpose of a semaphore is to restrict access to some critical region in a multithreaded program. Access can be mutually exclusive, resource determined or access determined. This package implementes 3 kinds of semaphores.
Mutex:
Restricts access to one thread at a time wirh support for nesting. Works like basic synchronization. People used to working with lowlevel languages might find this class closer to home.
Multex:
Allows for resource based multithreaded access to data. Access is allowed as long as there is at least one free resource. Possible use could be in a Provider/Consumer framework.
RWLock:
Enforces simultanious read access but exclusive write access.
Email:
Feedback should be sent to nclarke@diku.dk.