AliceFromWardenfell / philosophers

Two solutions to the problem of dining philosophers. The project was done in September 2021.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

philosophers

Two solutions to the problem of dining philosophers.
-In the first case philosophers are threads and forks are in between them.
-In the second case philosophers are processes and forks are in the middle of the table.

Task definition: subject

This project is written according to the Norm.

Short instructions:

  1. Type "make" in one of two directories
  2. Execute ./philo 'num_of_philos' 'time_to_die' 'time_to_eat' 'time_to_sleep' ['num_of_meals']
  • 'num_of_philos' is the number of philosophers and the number of forks
  • 'time_to_die' ms is the time in which the philosopher will die if he does not eat
  • 'time_to_eat' ms is the time it takes for a philosopher to eat
  • 'time_to_sleep' ms is the time it takes for a philosopher to sleep after eating
  • 'num_of_meals' [optional] is the number of meals to get one philosopher full;
    once all the philosophers are full, the simulation stops

About

Two solutions to the problem of dining philosophers. The project was done in September 2021.


Languages

Language:C 95.7%Language:Makefile 4.3%