Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mguardia10/42cursus_philosophers
philosophers with threads and mutex.
https://github.com/mguardia10/42cursus_philosophers
42 42born2code 42cursus 42philosophers 42school
Last synced: 30 days ago
JSON representation
philosophers with threads and mutex.
- Host: GitHub
- URL: https://github.com/mguardia10/42cursus_philosophers
- Owner: MGuardia10
- Created: 2023-12-23T11:19:49.000Z (almost 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-28T14:03:29.000Z (5 months ago)
- Last Synced: 2024-07-28T15:26:38.608Z (5 months ago)
- Topics: 42, 42born2code, 42cursus, 42philosophers, 42school
- Language: C
- Homepage:
- Size: 59.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 42cursus_philosophers
The mandatory part of this project asks us to solve the dining [philosophers problem](https://medium.com/@francescofranco_39234/dining-philosophers-problem-36d0030a4459) and implement a mutithreading solution using mutexes.![LINUX](https://img.shields.io/badge/Linux-a?style=for-the-badge&logo=linux&color=grey)
![C](https://img.shields.io/badge/C-a?style=for-the-badge&logo=C&color=grey)
![Makefile](https://img.shields.io/badge/Makefile-a?style=for-the-badge&logo=monster&logoColor=orange&color=grey)You can see the subject [**HERE.**](https://github.com/MGuardia10/42cursus/blob/main/subjects/en/philo_subject_en.pdf)
To visualize the output copy the actions made by the philosophers [**HERE.**](https://nafuka11.github.io/philosophers-visualizer/)
## Installing and running the project:
1- Clone this repository
git clone https://github.com/MGuardia10/42cursus_philosophers.git
2- Navigate to the new directory and run `make`
cd 42cursus_philosophers
make
3- `make clean` to remove the object files and work on a cleaner directorymake clean
4- Start the simulation using the correct arguments:./philo [number_of_meals]
## Compiling the Program
The philo program comes with a Makefile that includes the following rules:- `all`: compiles the program.
- `re`: recompiles the program.
- `clean`: removes obj directory with objects files.
- `fclean`: removes obj directory with objects files and philo binary.## Disclaimer
> At [42School](https://en.wikipedia.org/wiki/42_(school)), almost every project must be written in accordance to the [Norm](https://github.com/MGuardia10/42cursus/blob/main/subjects/en/norm_en.pdf), the school's coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.