https://github.com/mli42/at42philosophers
https://github.com/mli42/at42philosophers
42 fork multithreading mutex mutex-lock philosophers philosophers-dinner-problem pthread semaphore thread
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mli42/at42philosophers
- Owner: mli42
- Created: 2020-09-15T10:00:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T12:15:00.000Z (over 5 years ago)
- Last Synced: 2025-06-22T06:04:10.062Z (8 months ago)
- Topics: 42, fork, multithreading, mutex, mutex-lock, philosophers, philosophers-dinner-problem, pthread, semaphore, thread
- Language: C
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# at42Philosophers - [Philosophers Dining Problem](https://en.wikipedia.org/wiki/Dining_philosophers_problem)
Usage : `./binary number_of_philosopher time_to_die time_to_eat time_to_sleep [number_of_time_each_philosophers_must_eat]`
## philo_one uses:
- [pthread](https://www.youtube.com/watch?v=uA8X5zNOGw8&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=1)
- [pthread - pass arguments](https://www.youtube.com/watch?v=It0OFCbbTJE&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=2)
- [Mutex Locks](https://www.youtube.com/watch?v=9axu8CUvOKY&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=3)
- [`volatile` keyword](https://www.youtube.com/watch?v=6tIWFEzzx9I&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=8)
## philo_two uses:
- [Semaphore](https://www.youtube.com/watch?v=ukM_zzrIeXs&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=9)
## philo_three uses:
- Fork ⚠ Sharing data between child processes