Skip to content

Distributed "monitor" (mutex + condition variable) based on Ricart–Agrawala algorithm (C++, OpenMPI)

License

Notifications You must be signed in to change notification settings

phisikus/monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monitor

This project is an implementation of distributed "monitor" (mutual exclusion + condition variable) based on Ricart–Agrawala algorithm. It provides typical operations like lock/unlock/wait/signalOne/signalAll. You can create multiple mutexes and associated condition variables. With each mutex you can associate data structure that will act as a shared object and will be provided to process that currently has access to cirital section. Implementation uses OpenMPI library for communication.

Usage

You can compile this project using Makefile:

make clean && make

The base directory contains example solution of producer-consumer problem (see algorithms.hpp & main.cpp) that uses main library located in "src" subdirectory. You can run that example implementation using:

make run

It should create 10 processes and produce output that shows competition for resources.

License

See LICENSE file.

About

Distributed "monitor" (mutex + condition variable) based on Ricart–Agrawala algorithm (C++, OpenMPI)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published