To succeed this assignement:
[email protected]:AtibQur/philosophers.git cd philosophers makeThese commands will compile everything and a executable "philo" should be created.
To compile the program, run the following command:
cd philosophers && makeAfter creating the executable, the function is ready for use. This function only takes integers and will return errors if a non numeric character is used.
The program takes 4 or 5 arguments:
1: ./philo
2: amount of philosopher
3: time to eat
4: time to sleep
5: amount of meals to eat (optional)
./philo 3 410 200 200 5 --> will fail
./philo 4 410 200 200 5 --> will run till amount of times to eat is trueeducative
https://www.educative.io/answers/how-to-create-a-simple-thread-in-c
MichelleJiam tester
https://github.com/MichelleJiam/LazyPhilosophersTester/tree/9819a70a3f6bab412d6615d26d625d648fa3695a
Dining philosophers problem wikipedia
https://en.wikipedia.org/wiki/Dining_philosophers_problem
Jacob Sorber
How to create and join threads in C (pthreads):
https://www.youtube.com/watch?v=uA8X5zNOGw8&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=1
How to pass arguments to and get results from threads. (pthread_create, pthread_join):
https://www.youtube.com/watch?v=It0OFCbbTJE&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=2
How to pass arguments to and get results from threads. (pthread_create, pthread_join):
https://www.youtube.com/watch?v=9axu8CUvOKY&list=PL9IEJIKnBJjFZxuqyJ9JqVYmuFZHr7CFM&index=3