Giter Site home page Giter Site logo

philosophers's Introduction

philosophers

project of École 42 where it is necessary to solve the problem of dining philosophers in C using a separate thread for each philosopher.

the dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them. https://en.wikipedia.org/wiki/Dining_philosophers_problem

the goal is to create a program that simulate the 3 states of philosophers and print log of any change of status.

the project was made in accordance with the school design code standard in C language.

how to use

the project will work only on mas os.

last parameter is optional.

make
./philo num_of_ph time_to_die time_to_eat time_to_sleep [number_of_eat]

list of interesting cases

./philo 1 100 100 100   # should die
./philo 2 2 1 1         # should live
./philo 2 400 201 200   # should die
./philo 2 400 200 200   # should live
./philo 2 100 300 50    # should die
./philo 2 399 200 200   # should die
./philo 2 100 50 100    # should die
./philo 3 99 34 33      # should die
./philo 3 99 33 33      # should live
./philo 4 400 200 200   # should live
./philo 5 400 200 200   # should die

philosophers's People

Contributors

constbar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.