Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Philosophers

The classic Dining Philosophers problem in C.

Score Language
Last commit

ℹ️ About Project

The purpose of this project is to learn the basics of threading and mutexes, while replicating the well-known Dining Philosophers problem.

For detailed info, refer to this project subject.

🚀 Getting Started

Prerequisites

  • GCC compiler
  • Make utility
  • Unix-like system (Linux, macOS, WSL)

Install prerequisites

  • APT

    sudo apt install build-essential
  • Pacman

    sudo pacman -Sy base-devel

🔧 Build

  1. Clone the repository:

    git clone https://github.com/sdevsantiago/Philosophers.git
    cd Philosophers
  2. Compile the project:

    make -C philo   # Compile mandatory only
  3. Clean build files:

    make -C philo clean  # Remove object files
    make -C philo fclean # Remove all generated files
    make -C philo re     # Rebuild everything from scratch

👨‍💻 Usage

Basic Usage

./philo 10 410 200 200

📏 Norminette

The code strictly complies with 42's Norminette v4:

norminette *.c *.h

More info in the official Norminette repository.

🙇‍♂️ Special thanks

⚖️ License

This work is published under the terms of 42 Unlicense. This means you are free to use, modify, and share this software.

About

The classic Dining Philosophers problem in C.

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages