Skip to content

moelazhari/Philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

42 result

Philosophers

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

Environment

  • MacOS 11.4(Big Sur, Intel)

Developed and tested in this environment.

Compile

Mandatory

To compile the mandatory version, run the lines below.

$ git clone https://github.com/moelazhari/Philosophers.git
$ cd Philosophers
$ make

Bonus

To compile the bonus version,

$ git clone https://github.com/moelazhari/Philosophers.git
$ cd Philosophers
$ make bonus

Execute

Run compiled executable file.

Mandatory

$ cd philo
$ ./philo [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat]

Bonus

$ cd philo_bonus
$ ./philo_bonus [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published