An open API service indexing awesome lists of open source software.

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

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