{"id":26869438,"url":"https://github.com/anthippi/os-project","last_synced_at":"2026-04-18T11:31:25.019Z","repository":{"id":283741288,"uuid":"638881478","full_name":"Anthippi/OS-Project","owner":"Anthippi","description":"Implementation of a Pizza Order Management System using POSIX Threads and Synchronization Mechanisms (Mutexes, Condition Variables) on Linux/Lubuntu.","archived":false,"fork":false,"pushed_at":"2025-03-31T17:04:57.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-05T01:44:28.703Z","etag":null,"topics":["c","conditionvariables","lubuntu","mutexes","posix-threads","pthreads"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anthippi.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-05-10T09:56:54.000Z","updated_at":"2025-07-01T15:37:41.000Z","dependencies_parsed_at":"2025-08-26T11:31:33.654Z","dependency_job_id":null,"html_url":"https://github.com/Anthippi/OS-Project","commit_stats":null,"previous_names":["anthippi/os-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anthippi/OS-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anthippi%2FOS-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anthippi%2FOS-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anthippi%2FOS-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anthippi%2FOS-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anthippi","download_url":"https://codeload.github.com/Anthippi/OS-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anthippi%2FOS-Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272214419,"owners_count":24893201,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","conditionvariables","lubuntu","mutexes","posix-threads","pthreads"],"created_at":"2025-03-31T06:17:05.364Z","updated_at":"2026-04-18T11:31:19.984Z","avatar_url":"https://github.com/Anthippi.png","language":"C","readme":"# Pizza Order Management System with POSIX Threads\n\nThis project implements a pizza order management system using **POSIX threads (pthreads)** and synchronization mechanisms (mutexes, condition variables) on **Linux/Lubuntu**. The code simulates the concurrent operation of customers, cooks, ovens, packers, and delivery personnel.\n\n## Functionality Overview\n\n### 1. Order Process\n- Each customer is represented as a **separate thread**.\n- Customers connect at random intervals and place orders:\n  - Random number of pizzas (1-5).\n  - **60% probability** for a plain pizza (`Cplain = €10`) and **40%** for a special pizza (`Cspecial = €12`).\n  - **10% chance** for the order to fail.\n\n### 2. Resource Management\n- **Resource tracking** using mutexes and condition variables:\n  - **Cooks**: `Ncook = 2` (prepares pizzas in `Tprep = 1 minute/pizza`).\n  - **Ovens**: `Noven = 15` (bakes pizzas in `Tbake = 10 minutes`).\n  - **Packers**: `Npacker = 2` (packs pizzas in `Tpack = 1 minute/pizza`).\n  - **Delivery Personnel**: `Ndeliverer = 10` (delivers orders in random time `5-15 minutes`).\n\n### 3. Statistics\nAt the end of execution, the system displays:\n- Total income, failed/successful orders.\n- Sales count per pizza type.\n- Average and maximum delivery time.\n- Waiting times for baking and packing.\n\n## Code Structure\n- **Main File**: `pizzeria.c`  \n  Contains thread creation logic, resource synchronization, and statistics.\n- **Header File**: `pizzeria.h`  \n  Defines constants (e.g., number of cooks, timers).\n- **Test Script**: `test-res.sh`  \n  Compiles and runs the code:\n  ```bash\n  gcc pizzeria.c -o main -pthread\n  ./main 100 1000  # 100 orders, seed=1000```\n  \n## Notes\n- The code is written for Linux/Lubuntu.\n- Parallelism is used to simulate concurrent processes (e.g., multiple customers ordering simultaneously).\n\n## Example Execution\n```bash\n$ ./test-res.sh\nOrder #1 has been registered.\nCook #1 is handling order #1\n...\nTotal income: €1500\nFailed orders: 5\nSuccessful orders: 95\nTotal special pizzas sold: 38\nTotal normal pizzas sold: 57\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthippi%2Fos-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthippi%2Fos-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthippi%2Fos-project/lists"}