Skip to content

philo simulates the dining philosophers problem, which is a classic synchronization problem. The project involves managing multiple threads representing philosophers who alternately think, eat, and sleep.

Notifications You must be signed in to change notification settings

oumimoun/1337-Philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

PHILOSOFERS_42

PHILOSOFERS is a project part of the School 42 curriculum. It simulates the dining philosophers problem, which is a classic synchronization problem. The project involves managing multiple threads representing philosophers who alternately think, eat, and sleep.

Introduction

The dining philosophers problem is a classic computer science problem used to illustrate synchronization issues and techniques for resolving them. In this project, we simulate a number of philosophers sitting at a table, where each philosopher alternates between thinking, eating, and sleeping. The philosophers need forks to eat, and there are fewer forks than philosophers, which leads to potential deadlocks and starvation problems that need to be managed.

Features

  • Simulates the dining philosophers problem.
  • Uses multithreading to manage philosophers.
  • Implements synchronization mechanisms to avoid deadlocks and starvation.

Requirements

  • GCC or any C compiler.
  • pthread library for thread management.

Installation

Clone the repository and navigate to the project directory:

git clone git@github.com:oumimoun/1337-Philosophers.git
cd 1337-Philosophers
cd philo

Compile the program:

make

Usage

Run the compiled program:

./philo 2 800 200 300 10

You can adjust the number of philosophers and other parameters.

About

philo simulates the dining philosophers problem, which is a classic synchronization problem. The project involves managing multiple threads representing philosophers who alternately think, eat, and sleep.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published