{"id":19858091,"url":"https://github.com/matthprost/philosophers","last_synced_at":"2026-06-08T18:31:17.686Z","repository":{"id":119386397,"uuid":"85699182","full_name":"matthprost/philosophers","owner":"matthprost","description":"Philosophers is a C Epitech project","archived":false,"fork":false,"pushed_at":"2017-07-21T18:44:47.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T14:22:23.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthprost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-21T12:28:31.000Z","updated_at":"2020-06-04T09:05:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a06ba61-f95b-470a-a3ff-55a1a208031d","html_url":"https://github.com/matthprost/philosophers","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthprost%2Fphilosophers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthprost%2Fphilosophers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthprost%2Fphilosophers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthprost%2Fphilosophers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthprost","download_url":"https://codeload.github.com/matthprost/philosophers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241255116,"owners_count":19934815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T14:21:18.351Z","updated_at":"2026-06-08T18:31:12.665Z","avatar_url":"https://github.com/matthprost.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Philosophes\n===========\n\nL'objectif de ce projet et d'apprendre l'utilisation de multi-threads en C.\n\nSujet\n-----\n\nPlusieurs philosophes sont autour d'une table et possèdent chacun une baguette. \n\nUn philosophe peut: \n- Dormir\n- Manger\t\t\t\t\t\t\t\t\n- Réfléchir\n\t\t\t\t\t\t\t\t\t\t\nEn sachant qu'un philosophe peut uniquement manger s'il possède deux baguettes, réfléchir avec une seule baguette et dormir avec ou sans baguette.\n\nChaque philosophe possède un certain nombre de grain de riz qui est défini en argument au démarrage. Lorsqu'un philosophe mange, le nombre de grain de riz -= 1. Lorsqu'un philosophe arrive à 0 grains de riz alors tous les autres doivent arrêter de manger et le programme doit également s'arrêter.\n\nUn philosophe doit manger avant de dormir puis réfléchir. \nOn obtient donc l'ordre suivant: [manger -\u003e dormir -\u003e réfléchir] en boucle.\n\nL'objectif principal est d'équilibrer au maximum les actions manger, dormir et penser pour essayer d'obtenir un ratio de 1:1:1.\n\nUtilisation\n-----------\n\n```\n$\u003e make\n$\u003e ./philosophe -p X -e Y\n```\nX = nombre de philosophes et Y = nombre de grain de riz par philosophe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthprost%2Fphilosophers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthprost%2Fphilosophers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthprost%2Fphilosophers/lists"}