This project implements vector clocks and Maekawa's mutual exclusion algorithm for distributed systems.
CDistributedMutex
: Implementation of Maekawa's algorithm using vector clocks.NetworkLayer
: Handles network communication between processes.Logger
: Logging functionality for debugging and monitoring.
- No process crashes or network outages.
- Number of processes is fixed at startup and doesn't change during execution.
- Only one process runs on each machine.
To build the project:
- Requirements: C++17 and cmake.
- Navigate to the project root directory.
- Run the following commands:
mkdir build
cd build
cmake ..
make
The generated executable will be in the build/app
directory.
- Requirements: Docker and Docker Compose.
- Build the Docker containers. From root of repo run:
docker compose build
- Launch the Docker containers using the shell script. From root of repo run:
./start_containers.sh {NUM_HOSTS}
where NUM_HOSTS is 1-9.
Logs are written to standard output. Log level can be adjusted in the docker compose file using the LOG_LEVEL
env variable.
- Deadlocks are possible due to the lack of liveness in Maekawa v1.