In this project, you will learn the basics of threading a process. You will see how to create threads and you will discover mutexes. read the subject for more infrmetion.
Program name | philosophers |
Makefile | all , clean , fclean , re , bonus , rebonus |
Arguments | [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat] |
External functs. | usleep, gettimeofday, pthread_create, pthread_detach, pthread_join, pthread_mutex_init, pthread_mutex_destroy, pthread_mutex_lock, pthread_mutex_unlock |
Libft authorized | no |
Description | Philosophers with threads and mutexes |
- MacOS 11.4(Big Sur, Intel)
Developed and tested in this environment.
To compile the mandatory version, run the lines below.
$ git clone https://github.com/moelazhari/Philosophers.git
$ cd Philosophers
$ make
To compile the bonus version,
$ git clone https://github.com/moelazhari/Philosophers.git
$ cd Philosophers
$ make bonus
Run compiled executable file.
$ cd philo
$ ./philo [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat]
$ cd philo_bonus
$ ./philo_bonus [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat]