{"id":18991752,"url":"https://github.com/justine-george/seeking-tutor-problem-posix-threads","last_synced_at":"2026-06-29T02:31:18.447Z","repository":{"id":151750331,"uuid":"585058197","full_name":"justine-george/Seeking-Tutor-Problem-POSIX-Threads","owner":"justine-george","description":"Multithreaded simulation of a tutoring center coordination system using POSIX threads, mutex locks, and semaphores in C.","archived":false,"fork":false,"pushed_at":"2024-01-24T05:23:08.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T01:59:07.325Z","etag":null,"topics":["c","mutex-synchronisation","mutithreading","semaphores","simulation"],"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/justine-george.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":"2023-01-04T07:59:14.000Z","updated_at":"2024-09-10T09:42:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"78f6b672-2a77-49fd-8969-9473623747ad","html_url":"https://github.com/justine-george/Seeking-Tutor-Problem-POSIX-Threads","commit_stats":null,"previous_names":["justine-george/seeking-tutor-problem-posix-threads"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/justine-george/Seeking-Tutor-Problem-POSIX-Threads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justine-george%2FSeeking-Tutor-Problem-POSIX-Threads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justine-george%2FSeeking-Tutor-Problem-POSIX-Threads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justine-george%2FSeeking-Tutor-Problem-POSIX-Threads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justine-george%2FSeeking-Tutor-Problem-POSIX-Threads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justine-george","download_url":"https://codeload.github.com/justine-george/Seeking-Tutor-Problem-POSIX-Threads/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justine-george%2FSeeking-Tutor-Problem-POSIX-Threads/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34911134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"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","mutex-synchronisation","mutithreading","semaphores","simulation"],"created_at":"2024-11-08T17:14:58.630Z","updated_at":"2026-06-29T02:31:18.413Z","avatar_url":"https://github.com/justine-george.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-threaded POSIX Simulation of a Mentoring Center with Priority Scheduling (aka Seeking-Tutor-Problem)\n\nThis repository contains an implementation that models and synchronizes the activities of a coordinator, tutors, and students in a mentoring center using POSIX threads, mutex locks, and semaphores, as per the original problem described below.\n\n## Problem Description\n\nIn the computer science department's mentoring center (csmc), there are coordinators, tutors, and students. The center is equipped with a waiting area with several chairs and a separate tutoring area. The coordinators and tutors manage the flow of students based on their need for assistance and priority.\n\nStudents seeking help from tutors arrive at the center and wait in the available chairs. If no chairs are free, they return later. The coordinator organizes the students based on their priority, which depends on the frequency of their visits: first-time visitors have the highest priority. Students with the same priority level are queued based on their arrival time. Tutors, after being notified by the coordinator, assist the students with the highest priority.\n\n## Implementation Details\n\nThe implementation uses:\n\n- POSIX threads to simulate the concurrent activities of coordinators, tutors, and students\n- Mutex locks to manage access to shared resources like chairs\n- Semaphores to synchronize the interaction between students, tutors, and the coordinator\n\n## Compilation Format\n\nCompile the program using the following command:\n\n```bash\ngcc csmc.c -o csmc -Wall -Werror -pthread -std=gnu99\n```\n\n## Running the Program\n\nTo execute the program, use the following format:\n\n```bash\n./csmc #students #tutors #chairs #help\n```\n\n## Sample Usage\n\n### Input\n\n```bash\n./csmc 2 2 2 1\n```\n\n### Output\n\n````\nS: Student 1 takes a seat. Empty chairs = 1.  \nS: Student 2 takes a seat. Empty chairs = 0.  \nC: Student 1 with priority 0 added to the queue. Waiting students now = 1. Total requests = 1  \nT: Student 1 tutored by Tutor 1. Students tutored now = 0. Total sessions tutored = 1  \nS: Student 1 received help from Tutor 1.  \nC: Student 2 with priority 0 added to the queue. Waiting students now = 1. Total requests = 2  \nT: Student 2 tutored by Tutor 2. Students tutored now = 0. Total sessions tutored = 2  \nS: Student 2 received help from Tutor 2.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustine-george%2Fseeking-tutor-problem-posix-threads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustine-george%2Fseeking-tutor-problem-posix-threads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustine-george%2Fseeking-tutor-problem-posix-threads/lists"}