You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Philosophers
|
|
|
|
|
|
|
|
42 school project
|
|
|
|
|
|
|
|
## Subject :
|
|
|
|
<https://cdn.intra.42.fr/pdf/pdf/48443/fr.subject.pdf>
|
|
|
|
|
|
|
|
PHILOSOPHERS MANDATORY
|
|
|
|
===
|
|
|
|
|
|
|
|
## Docs :
|
|
|
|
[Threads](https://franckh.developpez.com/tutoriels/posix/pthreads/)
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
|
|
|
|
PHILOSOPHERS BONUS
|
|
|
|
===
|
|
|
|
## Docs :
|
|
|
|
[Semaphores](https://sites.uclouvain.be/SyllabusC/notes/Theorie/Threads/coordination.html)
|
|
|
|
|
|
|
|
## Structure :
|
|
|
|
|
|
|
|
Main :
|
|
|
|
|
|
|
|
- parsing() ->
|
|
|
|
- create table and *philos
|
|
|
|
- setup parameters
|
|
|
|
- create sticks semaphore
|
|
|
|
- init_philos() ->
|
|
|
|
- create array of childs pids
|
|
|
|
- for each philo, create a fork() :
|
|
|
|
- philo_life() ->
|
|
|
|
-
|
|
|
|
- loop
|