Git Product home page Git Product logo

fairlock's Introduction

FairLock.java

A Java Lock implementation that processes requests in a strictly FIFO order, following the signal-and-urgent semantic.

The assignement

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.

Usage

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();
}

Running the tests

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.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

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.

fairlock's People

Contributors

gabrieleara avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.