Giter VIP home page Giter VIP logo

concurrentlab_algorythms's Introduction

Java Synchronization Algorithms

This project demonstrates the implementation of classic synchronization algorithms in Java, including Dekker's, Lamport's, and Peterson's algorithms, along with an example of a semaphore. These implementations are designed to help understand the basics of process synchronization and mutual exclusion in concurrent programming.

Overview

  • Dekker's Algorithm: Ensures mutual exclusion between two threads.
  • Lamport's Bakery Algorithm: A more general algorithm that allows for mutual exclusion among N threads.
  • Peterson's Algorithm: Simplifies Dekker's approach for two threads, ensuring mutual exclusion with a simpler logic.
  • Semaphore Example: Demonstrates the use of semaphores to control access to a shared resource by multiple threads.

Main project of the mine-sightseeing simulation can be found in lab_src/src/simulation repository.

Getting Started

Prerequisites

  • Java JDK 11 or later
  • Your favorite IDE or text editor

Running the Examples

  1. Clone the repository:
git clone https://your-repository-url-here.git](https://github.com/Floressek/concurrentLab_algorythms)
  1. Navigate to the cloned directory:
cd java-synchronization-algorithms
  1. Compile the Java files (example):
javac Zadanie_1/Dekker.java Zadanie_2/Peterson.java Zadanie_3/Lamport.java Zadanie_4/SemaphoreExample.java
  1. Run the compiled Java classes (example):
java Zadanie_1.Dekker
java Zadanie_2.Peterson
java Zadanie_3.Lamport
java Zadanie_4.SemaphoreExample

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is open-sourced under the MIT License. See the LICENSE file for more details.

concurrentlab_algorythms's People

Contributors

floressek avatar

Stargazers

 avatar

Watchers

 avatar

concurrentlab_algorythms's Issues

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.