{"id":19150093,"url":"https://github.com/desmondjs/mining_synchronization_solution","last_synced_at":"2025-07-27T02:08:34.364Z","repository":{"id":249082700,"uuid":"830520082","full_name":"DesmondJS/Mining_Synchronization_Solution","owner":"DesmondJS","description":"This project is a solution to an Operating System assignment focusing on thread synchronization using POSIX semaphores and pthreads. The problem simulates a mining operation involving explorers, miners, and transporters.","archived":false,"fork":false,"pushed_at":"2024-07-25T14:56:55.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T05:42:45.524Z","etag":null,"topics":["c","multithreading","operating-system","posix-threads","semaphores","thread-synchronization"],"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/DesmondJS.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":"2024-07-18T12:41:44.000Z","updated_at":"2024-07-25T14:56:59.000Z","dependencies_parsed_at":"2024-11-09T08:10:42.938Z","dependency_job_id":"f1a67e6f-ddf8-4704-9c02-578ef0f56795","html_url":"https://github.com/DesmondJS/Mining_Synchronization_Solution","commit_stats":null,"previous_names":["desmondjs/mining_synchronization_solution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DesmondJS/Mining_Synchronization_Solution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesmondJS%2FMining_Synchronization_Solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesmondJS%2FMining_Synchronization_Solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesmondJS%2FMining_Synchronization_Solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesmondJS%2FMining_Synchronization_Solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DesmondJS","download_url":"https://codeload.github.com/DesmondJS/Mining_Synchronization_Solution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesmondJS%2FMining_Synchronization_Solution/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267285574,"owners_count":24064191,"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-07-27T02:00:11.917Z","response_time":82,"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","multithreading","operating-system","posix-threads","semaphores","thread-synchronization"],"created_at":"2024-11-09T08:10:36.016Z","updated_at":"2025-07-27T02:08:34.320Z","avatar_url":"https://github.com/DesmondJS.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mining Synchronization Solution\nThis project is a solution to an Operating System assignment focusing on thread synchronization using POSIX semaphores and pthreads. The problem simulates a mining operation involving explorers, miners, and transporters. The following guidelines and specifications are implemented in the solution:\n\n## Problem Description\n- **Explorers**: Simulated by threads that search for materials within a field, taking between 2-4 seconds to find the material. Once found, they signal the miners and continue exploring.\n- **Miners**: Activated by explorers' signals, these threads extract the material, taking 2-5 seconds. After extraction, miners wait for the next signal at the extraction location.\n- **Transporters**: Transport the extracted material to storage, requiring 4 seconds for a round trip. Once completed, they wait at the storage for the next signal.\n  \n## Features\n- Each explorer, miner, and transporter is simulated by separate threads running continuously.\n- Thread operations are synchronized using semaphores to ensure mutual exclusion and proper sequence of actions.\n- Threads print messages to indicate their current operations (e.g., exploring, mining, transporting).\n- The program gracefully handles interruption (CTRL+C) to cancel all threads and terminate the application.\n  \n## Implementation Details\n- The solution is implemented in POSIX C, utilizing pthread for multithreading and semaphores for synchronization.\n- Proper error handling for thread creation and semaphore initialization is included.\n- The source code is well-commented and uses meaningful variable and function names.\n  \n## Requirements\n- POSIX-compliant operating system (e.g., Linux).\n- GCC compiler or any other POSIX-compliant C compiler.\n  \n## How to Run\n1) Compile the program using gcc -pthread -o mining_solution mining_solution.c.\n2) Run the compiled program with ./mining_solution.\n3) Press CTRL+C to terminate the program.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesmondjs%2Fmining_synchronization_solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesmondjs%2Fmining_synchronization_solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesmondjs%2Fmining_synchronization_solution/lists"}