A Java Lock implementation that processes requests in a strictly FIFO order, following the signal-and-urgent semantic.
This project has beed developed for the Concurrent and Distributed Systems class of Embedded Computing Systems Master degree at Scuola Sant'Anna of Pisa.
The original assignement (part of it) is the following:
Implement a synchronization mechanism similar to the mechanism provided by java within the java.util.concurrent packages (Explicit Locks and Condition variables) but whose behaviour is in accordance with the semantic "signal-and-urgent".
The signal-and-urgent semantic referred here is the one defined by C.A.R. Hoare.
The usage of this class is illustrated in the manager subfolder, in which we implement a Single Resource Manager class following different patterns.
Anyway its usage is basically the same of the standard Java Lock class, except for the different implementation. An associated Condition class is also provided, exactly like the original Lock class.
FairLock l = new FairLock();
l.lock();
try {
// access the resource protected by this lock
} finally {
l.unlock();
}
This project contains also a class defined to test the correct behavior of the FairLock class and the Managers defined with it. You can find it under the test subfolder. See Javadoc for further information.
This project is licensed under the MIT License - see the LICENSE file for details
A great acknowledgement to professor Paolo Ancilotti, who held for us this class and explained us with such patience all the threats to a distributed or concurrent system and how to handle them.