Giter VIP home page Giter VIP logo

disys_mandaexercise2's Introduction

DISYS Mandatory Exercise 2

Ricart-Agrawala Algorithm

Our implementation is a UDP based approach to the Ricart-Agrawala algorithm for mutual exclusion on a distributed system

Usage

The program consists of two golang files;

  1. shared_resource.go -> Represents the critical section of the system
  2. client.go -> Represents the nodes in the system

To run the program, first run the shared_resource.go

$ go run ./Implementation/shared_resource.go

Next open multiple terminals that you would like to use as clients.
Client.go takes multiple arguments, depending on the number of clients.

  • The first argument is the id of the client you want to initialize.
  • The second (and other) argument(s) is the port on localhost on which the clients will operate.

Under here is an example of executing three different clients (each client to be executed in its own terminal).

$ go run ./Implementation/client.go 1 8080 8081 8082
$ go run ./Implementation/client.go 2 8080 8081 8082
$ go run ./Implementation/client.go 3 8080 8081 8082

To make a request to access the critical section, write the command request within a terminal executing the client.

$ request

Authored by

References

As research on the topic, we gained some insight and references by looking at implementations by DylanNS and joaopmgd

disys_mandaexercise2's People

Contributors

gmcblaxk avatar

Watchers

Markusgp avatar

Forkers

gmcblaxk

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.