Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamareebjamal/semaphores-example
Basic process synchronisation using semaphores in linux demonstrated by special kind of Dining Philosophers problem
https://github.com/iamareebjamal/semaphores-example
cpp dining-philosophers-problem process-synchronisation semaphore
Last synced: 23 days ago
JSON representation
Basic process synchronisation using semaphores in linux demonstrated by special kind of Dining Philosophers problem
- Host: GitHub
- URL: https://github.com/iamareebjamal/semaphores-example
- Owner: iamareebjamal
- License: apache-2.0
- Created: 2017-02-14T12:00:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-15T20:21:11.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T08:51:59.824Z (2 months ago)
- Topics: cpp, dining-philosophers-problem, process-synchronisation, semaphore
- Language: C++
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dining Philosophers using Semaphores
[![Codacy grade](https://img.shields.io/codacy/grade/e05f34ee709541de8446efca8cf15f0e.svg)]()
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)> Basic process synchronisation using semaphores in linux demonstrated by special kind of Dining Philosophers problem
Project used POSIX semaphores to synchronise chopsticks among 6 philosophers sitting across a table.
See [this](https://en.wikipedia.org/wiki/Dining_philosophers_problem)
### Description
This repo contains a special form of this problem.
- There are only 3 chopsticks shared among the philosophers
- There are 4 chopsticks on the table
- First, the philospher has to pick up a chopstick from his side (from the 3 fixed ones)
- Then, he has to pick one from the 4 kept on table. There is no resourse hierarchy among these, nor any absolute posiition.
- Eat! Profit### *classic* branch
The `classic` branch contains the solution to the original classic problem
### Author
Areeb Jamal - [@iamareebjamal](https://github.com/iamareebjamal)