{"id":26494686,"url":"https://github.com/antonashraf/multi-process-and-threading-assignments","last_synced_at":"2025-07-02T13:34:53.382Z","repository":{"id":282649246,"uuid":"949243203","full_name":"AntonAshraf/Multi-Process-and-Threading-Assignments","owner":"AntonAshraf","description":"C programming assignments on process management and multithreading. Includes a multi-process file-handling program and a restaurant ordering system using semaphores and threads.","archived":false,"fork":false,"pushed_at":"2025-03-16T02:04:44.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T03:18:51.982Z","etag":null,"topics":["c-language","operating-system","semaphore","threads"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntonAshraf.png","metadata":{"files":{"readme":"README.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}},"created_at":"2025-03-16T01:58:29.000Z","updated_at":"2025-03-16T02:05:54.000Z","dependencies_parsed_at":"2025-03-16T03:18:54.048Z","dependency_job_id":"de639f02-eeb7-4b8c-801f-30fb2b7ddc55","html_url":"https://github.com/AntonAshraf/Multi-Process-and-Threading-Assignments","commit_stats":null,"previous_names":["antonashraf/multi-process-and-threading-assignments"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonAshraf%2FMulti-Process-and-Threading-Assignments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonAshraf%2FMulti-Process-and-Threading-Assignments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonAshraf%2FMulti-Process-and-Threading-Assignments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonAshraf%2FMulti-Process-and-Threading-Assignments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntonAshraf","download_url":"https://codeload.github.com/AntonAshraf/Multi-Process-and-Threading-Assignments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244592964,"owners_count":20477990,"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":["c-language","operating-system","semaphore","threads"],"created_at":"2025-03-20T10:24:21.337Z","updated_at":"2025-03-20T10:24:22.967Z","avatar_url":"https://github.com/AntonAshraf.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Process-and-Threading-Assignments\n\nC programming assignments on process management and multithreading. Includes a multi-process file-handling program and a restaurant ordering system using semaphores and threads.\n\n## Overview\n\nThis repository contains two C programming assignments demonstrating process management and multithreading concepts:\n\n1. **Multi-Process File Handling** – Uses forked child processes to compute factorials, list running processes, and calculate averages while handling file I/O.\n2. **Multi-Threaded Restaurant Ordering System** – Simulates a restaurant workflow with customers, chefs, and waiters using threads and semaphores.\n\n---\n\n## Assignment 1: Multi-Process File Handling\n\n### Description\n\nThis program reads input data from a file and processes it using three child processes:\n\n- **Factorial Calculation** – Computes the factorial of a given number.\n- **Process Listing** – Retrieves and saves a list of running processes.\n- **Average Calculation** – Computes the average of a set of numbers.\n\nThe parent process manages execution and consolidates outputs.\n\n### Compilation \u0026 Execution\n\n```sh\ngcc -o assignmentB assignmentB.c\n./assignmentB\n```\n\n### Expected Output\n\n- `factorial_result.txt` (Factorial computation result)\n- `process_list.txt` (List of running processes)\n- `average_result.txt` (Computed average of numbers)\n\n---\n\n## Assignment 2: Multi-Threaded Restaurant Ordering System\n\n### Description\n\nThis program simulates a restaurant where:\n    - **Customers** place orders.\n    - **Chefs** prepare food.\n    - **Waiters** serve the orders.\n\nSynchronization is managed using counting semaphores to ensure smooth order handling.\n\n### Compilation \u0026 Execution\n\n```sh\ngcc -o restaurant_system 12thassignmentB.c -pthread\n./restaurant_system\n```\n\n### Features\n\n- Uses semaphores to limit the number of simultaneous customers, active orders, and serving operations.\n- Proper synchronization to prevent race conditions.\n\n---\n\n## License\n\nThis project is for educational purposes. Feel free to modify and enhance it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonashraf%2Fmulti-process-and-threading-assignments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonashraf%2Fmulti-process-and-threading-assignments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonashraf%2Fmulti-process-and-threading-assignments/lists"}