{"id":23275588,"url":"https://github.com/khushal-me/cpu-scheduler","last_synced_at":"2025-07-17T10:38:32.618Z","repository":{"id":263917373,"uuid":"886491331","full_name":"Khushal-Me/Cpu-Scheduler","owner":"Khushal-Me","description":"C program to simulate different CPU scheduling algorithms.","archived":false,"fork":false,"pushed_at":"2024-11-21T00:48:02.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T23:04:05.989Z","etag":null,"topics":["algorithms","c","cpu-scheduling"],"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/Khushal-Me.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":"2024-11-11T04:19:52.000Z","updated_at":"2024-12-10T19:03:50.000Z","dependencies_parsed_at":"2024-11-21T01:40:41.988Z","dependency_job_id":null,"html_url":"https://github.com/Khushal-Me/Cpu-Scheduler","commit_stats":null,"previous_names":["khushal-me/cpu-scheduler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Khushal-Me/Cpu-Scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Khushal-Me%2FCpu-Scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Khushal-Me%2FCpu-Scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Khushal-Me%2FCpu-Scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Khushal-Me%2FCpu-Scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Khushal-Me","download_url":"https://codeload.github.com/Khushal-Me/Cpu-Scheduler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Khushal-Me%2FCpu-Scheduler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265596136,"owners_count":23794843,"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":["algorithms","c","cpu-scheduling"],"created_at":"2024-12-19T21:15:03.917Z","updated_at":"2025-07-17T10:38:32.602Z","avatar_url":"https://github.com/Khushal-Me.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPU Scheduler\n\nA C implementation of common CPU scheduling algorithms including First Come First Served (FCFS), Shortest Job First (SJF), and round-robin scheduling.\n\n## 📜 Description\n\nThis program implements three fundamental CPU scheduling algorithms:\n\n1. **First Come First Served (FCFS)**: A non-preemptive scheduling algorithm that executes processes in the order they arrive.\n2. **Shortest Job First (SJF)**: A non-preemptive scheduling algorithm that executes the process with the shortest burst time first.\n3. **Round Robin (RR)**: A preemptive scheduling algorithm that uses a fixed time quantum to execute processes in a circular queue.\n\n## 🚀 Features\n\n- Implementation of three different scheduling algorithms\n- Process management with arrival time and burst time\n- Calculation of waiting time and turnaround time for each process\n- Computation of average waiting time and average turnaround time\n- Support for reading process data from input files\n- Detailed execution timeline output\n- Final statistics summary\n\n## ⚙️ Getting Started\n\n### Prerequisites\n\n- GCC compiler\n\n### Compilation\n\n```bash\ngcc -o scheduler cpu_scheduler.c\n```\n\n### Usage\n\nThe program accepts command-line arguments in the following format:\n\n```natural\n./scheduler [-f|-s|-r \u003cquantum_number\u003e] \u003cinput_file\u003e\n```\n\nWhere:\n- `-f`: Run First Come First Served algorithm\n- `-s`: Run Shortest Job First algorithm\n- `-r \u003cquantum_number\u003e`: Run Round Robin algorithm with specified time quantum\n- `\u003cinput_file\u003e`: Path to the input file containing process data\n\n### Input File Format\n\nThe input file should contain process information in the following format:\n```\nP1,6\nP2,3\nP3,8\n```\nEach line represents a process with:\n- Process ID (Px where x is the process number)\n- Burst time (comma-separated integer value)\n\n## Example Usage\n\n1. For FCFS scheduling:\n```bash\n./scheduler -f input.txt|input.csv\n```\n\n2. For SJF scheduling:\n```bash\n./scheduler -s input.txt|input.csv\n```\n\n3. For Round Robin scheduling with quantum = 2:\n```bash\n./scheduler -r 2 input.txt|input.csv\n```\n\n## Output\n\nThe program provides detailed output including:\n- Step-by-step execution timeline\n- Process state at each time unit\n- Final statistics for each process including:\n  - Waiting time\n  - Turnaround time\n- Overall average waiting time and turnaround time\n\n## Implementation Details\n\nThe scheduler uses the following key data structures:\n- `Process` struct to store process information\n- Circular queue implementation for round-robin scheduling\n- Arrays for process management and scheduling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhushal-me%2Fcpu-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhushal-me%2Fcpu-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhushal-me%2Fcpu-scheduler/lists"}