Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floressek/concurrentlab_algorythms
Codes from Concurrency Labs
https://github.com/floressek/concurrentlab_algorythms
algorithms java
Last synced: 8 days ago
JSON representation
Codes from Concurrency Labs
- Host: GitHub
- URL: https://github.com/floressek/concurrentlab_algorythms
- Owner: Floressek
- Created: 2024-03-24T22:30:02.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-06-19T14:27:44.000Z (5 months ago)
- Last Synced: 2024-10-10T11:25:12.409Z (28 days ago)
- Topics: algorithms, java
- Language: Java
- Homepage:
- Size: 166 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# 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:
```bash
git clone https://your-repository-url-here.git](https://github.com/Floressek/concurrentLab_algorythms)
```3. Navigate to the cloned directory:
```bash
cd java-synchronization-algorithms
```3. Compile the Java files (example):
```bash
javac Zadanie_1/Dekker.java Zadanie_2/Peterson.java Zadanie_3/Lamport.java Zadanie_4/SemaphoreExample.java
```4. Run the compiled Java classes (example):
```bash
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.