Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ugolinolle/philosophers
💻・Philosophers is a project to solve the dining philosophers problem.
https://github.com/ugolinolle/philosophers
42 c philosophers42 thread
Last synced: about 18 hours ago
JSON representation
💻・Philosophers is a project to solve the dining philosophers problem.
- Host: GitHub
- URL: https://github.com/ugolinolle/philosophers
- Owner: UgolinOlle
- License: mit
- Created: 2024-01-26T09:47:53.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-07-29T08:32:13.000Z (4 months ago)
- Last Synced: 2024-07-29T11:38:45.826Z (4 months ago)
- Topics: 42, c, philosophers42, thread
- Language: C
- Homepage: https://ugolin-olle.com/projects/philosophers
- Size: 83 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Philosophers
[![42 School Project](https://img.shields.io/badge/42%20Project-Philosophers-blue)](https://github.com/your-username/philosophers)
[![Language: C](https://img.shields.io/badge/language-C-green.svg)]()## 💻・Description
Philosophers is a project that introduces the basics of threading a process and how to work with mutexes. It simulates a classic synchronization problem: the dining philosophers problem.
**Features:**
- Simulates philosophers eating, thinking, and sleeping
- Uses threads to represent each philosopher
- Implements mutexes to handle resource sharing (forks)
- Ensures no philosopher starves**Technologies Used:**
- C Language
- POSIX Threads
- Mutexes## ⌨️・Usage
1. Compile the program:
```bash
make
```2. Run the program with the following arguments:
```bash
./philo number_of_philosophers time_to_die time_to_eat time_to_sleep [number_of_times_each_philosopher_must_eat]
```### Example:
```bash
./philo 5 800 200 200 7
```## 🧑🤝🧑・Contributing
Contributions to this project are welcome. If you find any issues or want to improve the code, please feel free to open a pull request or issue.
## 📑・License
This project is licensed under the [MIT License](https://github.com/UgolinOlle/philosophers/blob/master/LICENSE) - see the LICENSE file for details.
## 📩・Contact
If you have any questions or would like to collaborate, please do not hesitate to contact me at [email](mailto:[email protected]) or [LinkedIn](https://linkedin.com/in/ugolin-olle)