{"id":21050651,"url":"https://github.com/adolbyb/process-scheduler","last_synced_at":"2026-07-18T18:38:55.302Z","repository":{"id":156942248,"uuid":"442822540","full_name":"ADolbyB/process-scheduler","owner":"ADolbyB","description":"A C++ process scheduler project using predefined processes and queue structs ","archived":false,"fork":false,"pushed_at":"2026-01-31T15:58:08.000Z","size":1008,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T03:37:26.154Z","etag":null,"topics":["c-plus-plus","cpp","fcfs-scheduling","mlfq-scheduling","process-scheduler","process-scheduling-algorithms","queue","sjf-scheduling","struct"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ADolbyB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-29T16:02:27.000Z","updated_at":"2026-01-31T15:57:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd77ea09-645f-4a26-b9b5-66207d64cffa","html_url":"https://github.com/ADolbyB/process-scheduler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ADolbyB/process-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fprocess-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fprocess-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fprocess-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fprocess-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ADolbyB","download_url":"https://codeload.github.com/ADolbyB/process-scheduler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fprocess-scheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35627692,"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-07-18T02:00:07.223Z","response_time":61,"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-plus-plus","cpp","fcfs-scheduling","mlfq-scheduling","process-scheduler","process-scheduling-algorithms","queue","sjf-scheduling","struct"],"created_at":"2024-11-19T15:46:42.864Z","updated_at":"2026-07-18T18:38:55.296Z","avatar_url":"https://github.com/ADolbyB.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# CPU Process Scheduler\n### Operating Systems Scheduling Algorithm Implementation\n\n[![Stars](https://img.shields.io/github/stars/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=github)](https://github.com/ADolbyB/process-scheduler/stargazers)\n[![Forks](https://img.shields.io/github/forks/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=github)](https://github.com/ADolbyB/process-scheduler/network/members)\n[![Build](https://img.shields.io/github/actions/workflow/status/ADolbyB/process-scheduler/build-release.yml?style=for-the-badge\u0026logo=github\u0026logoColor=white\u0026label=BUILD%20%26%20RELEASE)](https://github.com/ADolbyB/process-scheduler/actions/workflows/build-release.yml)\n[![Last Commit](https://img.shields.io/github/last-commit/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=github)](https://github.com/ADolbyB/process-scheduler/commits/main)\n\n**Operating Systems Course Project - Grade: 98/100**\n\n[![C++](https://img.shields.io/badge/C++-00599C?style=for-the-badge\u0026logo=cplusplus\u0026logoColor=white)](https://isocpp.org/)\n[![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)](https://www.linux.org/)\n[![Code::Blocks](https://img.shields.io/badge/Code::Blocks-000000?style=for-the-badge)](http://www.codeblocks.org/)\n\n**Developed by:** [![ADolbyB](https://img.shields.io/badge/ADolbyB-Profile-blue?style=for-the-badge\u0026logo=github)](https://github.com/ADolbyB)\n\n\u003c/div\u003e\n\n---\n\n## 🎯 Project Overview\n\nA comprehensive **CPU process scheduling simulator** implementing three fundamental operating system scheduling algorithms. This project demonstrates core OS concepts including process management, queue data structures, CPU burst scheduling, and I/O handling using predefined process workloads.\n\n**Key Features:**\n- ✅ Three distinct scheduling algorithms (FCFS, SJF, MLFQ)\n- ✅ Custom queue implementations for process management\n- ✅ Realistic CPU and I/O burst simulation\n- ✅ Performance metrics and visualization\n- ✅ GDB debugging support\n\n---\n\n## 🏆 Academic Achievement\n\n**Course:** Operating Systems  \n**Institution:** Florida Atlantic University  \n**Semester:** Fall 2021  \n**Final Grade:** **98/100**\n\nThis project earned near-perfect marks for implementing complex scheduling algorithms with clean, efficient C++ code and proper data structure design.\n\n---\n\n## 📚 Scheduling Algorithms Implemented\n\n### 1. FCFS - First Come First Served\n\n**Algorithm Type:** Non-preemptive\n\n**Description:**\n- Single Ready Queue and single I/O Queue\n- Processes execute in order of arrival\n- Each process runs until CPU burst completion\n- Simple but can suffer from convoy effect\n- Worst case scenario benchmark for average total wait time `T_w`\n\n**Characteristics:**\n- No process starvation\n- Low scheduling overhead\n- Poor average waiting time for short processes\n- Ideal for batch processing systems\n\n**Queue Structure:**\n```\nReady Queue: [P1] → [P2] → [P3] → [P4]\n                ↓ (CPU Burst Complete)\nI/O Queue:   [P1] → [P2] → ...\n```\n\n---\n\n### 2. SJF - Shortest Job First\n\n**Algorithm Type:** Non-preemptive\n\n**Description:**\n- Single Ready Queue and single I/O Queue\n- Processes ordered by shortest CPU burst time\n- Minimizes average waiting time\n- Requires knowledge of burst times (predefined in this implementation)\n- Best case scenario benchmark for average total wait time `T_w`\n\n**Characteristics:**\n- Optimal average waiting time\n- Risk of starvation for long processes\n- Efficient for known workloads\n- Difficult to implement in real systems (requires prediction)\n\n**Queue Structure:**\n```\nReady Queue (sorted by burst time):\n[P3: 5ms] → [P1: 10ms] → [P4: 15ms] → [P2: 20ms]\n```\n\n---\n\n### 3. MLFQ - Multi-Level Feedback Queue\n\n**Algorithm Type:** Preemptive\n\n**Description:**\n- Three-tier Ready Queue system with priority levels\n- Single I/O Queue\n- Dynamic priority adjustment based on behavior\n- Prevents starvation while favoring interactive processes\n\n**Queue Structure:**\n```\nQueue 1 (Highest Priority): Round Robin (Time Quantum T_q = 5)\nQueue 2 (Medium Priority):  Round Robin (Time Quantum T_q = 10)\nQueue 3 (Lowest Priority):  FCFS (No time quantum)\nI/O Queue:                  FCFS (Unlimited devices)\n```\n\n**Priority Rules:**\n- New processes and I/O returning processes → Queue 1\n- Process doesn't complete in Queue 1 → Demoted to Queue 2\n- Process doesn't complete in Queue 2 → Demoted to Queue 3\n- Higher queues preempt lower queues\n- Queue N only runs when Queues 1 through N-1 are empty\n\n**Advantages:**\n- Balances turnaround time and response time\n- Adapts to process behavior dynamically\n- Prevents starvation through aging\n- Favors I/O-bound (interactive) processes\n\n---\n\n## 🔧 Technical Implementation\n\n### Process Definition\n\nEach process consists of alternating CPU and I/O burst times:\n\n```cpp\nProcess Structure: {CPU, I/O, CPU, I/O, ..., CPU}\n```\n\n**Requirements:**\n- ✅ Must begin with a CPU burst\n- ✅ Must end with a CPU burst\n- ✅ Alternates between CPU and I/O operations\n\n**Example Process:**\n```cpp\nProcess P1 = {5, 3, 8, 4, 6};  // CPU → I/O → CPU → I/O → CPU\n```\n\n### I/O Handling\n\n**Unlimited I/O Devices Assumption:**\n- All processes in I/O queue execute simultaneously\n- All I/O burst counters decrement in parallel\n- Processes leave I/O queue immediately upon completion\n- Realistic for systems with high I/O parallelism\n\n### Queue Operations\n\n**Key Operations Implemented:**\n- `Make_process()` - makes a queue of nodes by reading a process file\n- `add_back()` - Add a node to the BACK\n- `deQueue()` - delete a node from the FRONT\n- `Print_proc_nodes()` - iterates the queue and prints the list of nodes\n- `remove()` - removes a node from the middle of a queue\n- `FCFS_SJF_increment_wait()` - increments the wait times of processes in the ready queue\n- `FCFS_SJF_add_to_queue()` - ONLY for FCFS and SJF to transfer nodes between queues\n- `FCFS_SJF_CPU_queue_timer()` - decrements CPU time of front node and increments global clock\n- `FCFS_SJF_IO_queue_timer()` - decrements I/O time of all nodes simultaneously, increments total IO clock\n- `MLFQ_increment_wait()` - increments all wait times of all ready queues for MLFQ\n- `MLFQ_add_to_queue()` - ONLY for MLFQ to transfer nodes between queues\n- `MLFQ_CPU_timer()` - Function only called for MLFQ Queue timers: Called by `Ready_1()`\n- `MLFQ_IO_queue_timer()`- decrements I/O time of entire queue,increments total IO clock\n- `Print_ready_IO()` - iterates the queue and prints the list of nodes.\n- `Results()` - calculates and prints results: Ave T_wait, Ave T_turnaround, Ave T_response\n\n---\n\n## 📂 Repository Structure\n\n```\nprocess-scheduler/\n├── Documentation/            # Project screenshots\n│   ├── Results_FCFS.png      # FCFS algorithm output\n│   ├── Results_SJF.png       # SJF algorithm output\n│   └── Results_MLFQ.png      # MLFQ algorithm output\n├── Processes/                # Process definition files\n│   ├── p1.txt                # Predefined Process 1\n│   ├── p2.txt                # Predefined Process 2\n│   ├── ...\n│   └── p8.txt                # Predefined Process 8\n├── processes.h               # Process structure declarations\n├── processes.cpp             # Process management implementation\n├── queues.cpp                # Queue data structure implementation\n├── sched_driver.cpp          # Main driver and scheduling logic\n└── README.md                 # This document\n```\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n**Development Environment:**\n- Linux operating system (Ubuntu, Mint, Fedora, etc.)\n- GNU g++ compiler (C++11 or higher)\n- Code::Blocks IDE v20.03+ (optional)\n- GDB debugger (for debugging)\n- Make build system (optional)\n\n### Compilation\n\n**Method 1: Command Line (Recommended)**\n\n```bash\n# Clone the repository\ngit clone https://github.com/ADolbyB/process-scheduler.git\ncd process-scheduler\n\n# Compile with g++\ng++ -std=c++11 -Wall -Werror *.cpp *.h -o sched_driver\n\n# Run the scheduler\n./sched_driver\n```\n\n**Method 2: With Debugging Support**\n\n```bash\n# Compile with debug symbols\ng++ -g -std=c++11 -Wall -Werror *.cpp *.h -o sched_driver\n\n# Launch with GDB\ngdb ./sched_driver\n\n# GDB commands:\n# (gdb) run              - Start execution\n# (gdb) break main       - Set breakpoint\n# (gdb) next             - Step over\n# (gdb) step             - Step into\n# (gdb) print variable   - Inspect variable\n# (gdb) quit             - Exit GDB\n```\n\n**Method 3: Code::Blocks IDE**\n\n1. Launch Code::Blocks IDE\n2. Create New Project:\n   - File → New → Project\n   - Console Application → C++\n   - Name: `process-scheduler`\n   - Select project location\n   - Compiler: GNU GCC\n3. Remove default `main.cpp`\n4. Add project files:\n   - Right-click project → Add files\n   - Select all `.cpp` and `.h` files\n5. Build and Run: F9\n\n### Usage\n\n```bash\n$ ./sched_driver\n\n=\u003e\u003e Process Scheduler \u003c\u003c=\n*** Make a Selection: ***\n1) Run FCFS Algorithm\n2) Run SJF Algorithm\n3) Run MLFQ Algorithm\n4) Exit\n\n```\n\nSelect algorithm by number and observe:\n- Process execution timeline\n- Queue state changes\n- CPU utilization\n- Average waiting time\n- Average turnaround time\n\n---\n\n## 📊 Output Examples\n\n### FCFS Algorithm Output\n\n[![FCFS Output](Documentation/Results_FCFS.png)](Documentation/Results_FCFS.png)\n\n**Performance Characteristics:**\n- Execution order: P1 → P2 → P3 → P4 (arrival order)\n- No preemption or reordering\n- Simple but potentially inefficient\n\n---\n\n### SJF Algorithm Output\n\n[![SJF Output](Documentation/Results_SJF.png)](Documentation/Results_SJF.png)\n\n**Performance Characteristics:**\n- Execution order: Sorted by CPU burst length\n- Minimizes average waiting time\n- Optimal for known workloads\n\n---\n\n### MLFQ Algorithm Output\n\n[![MLFQ Output](Documentation/Results_MLFQ.png)](Documentation/Results_MLFQ.png)\n\n**Performance Characteristics:**\n- Dynamic priority adjustment\n- Time quantum enforcement\n- Queue demotion on timeout\n- Responsive to interactive processes\n\n---\n\n## 💡 Key Concepts Demonstrated\n\n### Operating Systems Theory\n\n| Concept | Implementation |\n|---------|----------------|\n| **Process Scheduling** | Three distinct algorithms with different policies |\n| **Context Switching** | Preemption in MLFQ with state preservation |\n| **Queue Management** | Custom queue data structures for process lists |\n| **CPU Burst** | Timed execution periods for computational work |\n| **I/O Burst** | Simulated I/O operations with wait times |\n| **Priority Scheduling** | Multi-level queues with dynamic priorities |\n| **Starvation Prevention** | MLFQ aging and priority boost mechanisms |\n\n### Data Structures\n\n- **Linked List Queues** - Dynamic process queue management\n- **Process Control Blocks (PCBs)** - Process state and metadata\n- **Priority Queues** - SJF ordered insertion\n- **Multi-Queue System** - MLFQ three-tier structure\n\n### Performance Metrics\n\n**Calculated for each algorithm:**\n- Average Waiting Time\n- Average Turnaround Time\n- CPU Utilization\n- Context Switch Count\n\n---\n\n## 🧪 Testing \u0026 Validation\n\n**Test Cases:**\n- ✅ Single process execution\n- ✅ Multiple processes with varying burst times\n- ✅ I/O-bound vs CPU-bound process mixes\n- ✅ Process arrival order variations\n- ✅ Queue preemption scenarios (MLFQ)\n- ✅ Edge cases (empty queues, single burst processes)\n\n**Validation Methods:**\n- Manual calculation verification\n- Output log analysis\n- Performance metric comparison\n- GDB step-through debugging\n\n---\n\n## 📖 Learning Outcomes\n\n**Skills Demonstrated:**\n- ✅ Operating system scheduling algorithm implementation\n- ✅ Custom data structure design (queues, process lists)\n- ✅ C++ object-oriented programming\n- ✅ Pointer management and memory efficiency\n- ✅ Algorithm complexity analysis\n- ✅ Linux development environment proficiency\n- ✅ Professional code documentation\n\n---\n\n## 🎓 Academic Context\n\n**Course Learning Objectives Met:**\n1. Understand CPU scheduling algorithms and policies\n2. Implement process management data structures\n3. Analyze algorithm performance trade-offs\n4. Design efficient queue management systems\n5. Debug complex C++ systems code\n\n**Project Requirements:**\n- Multiple scheduling algorithms\n- Predefined process workloads\n- Queue-based process management\n- Performance metrics calculation\n- Clean, documented code\n\n---\n\n## 🤝 Contributing\n\nThis is a completed academic project, but improvements are welcome:\n- 📝 Documentation enhancements\n- 🐛 Bug fixes\n- 💡 Additional scheduling algorithms (Priority, Round Robin variants)\n- 📊 Enhanced visualization\n- ⚡ Performance optimizations\n\n---\n\n## 📄 License\n\nThis project is licensed under the GNU GPL v3 License - see the [LICENSE.md](https://github.com/ADolbyB/process-scheduler/blob/main/LICENSE.md) file for details.\n\n**Academic Integrity Notice:** This repository represents completed coursework (98/100). Use as a learning resource to understand scheduling algorithms and C++ implementation, but develop your own solutions for assignments.\n\n---\n\n## 📧 Contact\n\n**Developer:** [Joel Brigida](https://github.com/ADolbyB)  \n**LinkedIn:** [Joel Brigida](https://www.linkedin.com/in/joelmbrigida/)  \n**Course:** Operating Systems, Fall 2021\n\nQuestions about implementation details? Feel free to open an issue!\n\n---\n\n## 📊 Repository Stats\n\n\u003cdiv align=\"center\"\u003e\n\n![Repo Size](https://img.shields.io/github/repo-size/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=github)\n![Languages Count](https://img.shields.io/github/languages/count/ADolbyB/process-scheduler?style=for-the-badge)\n![Top Language](https://img.shields.io/github/languages/top/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=cplusplus)\n![Commits](https://img.shields.io/github/commit-activity/t/ADolbyB/process-scheduler?style=for-the-badge\u0026logo=github)\n\n\u003c/div\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Master Operating Systems. Understand Scheduling. Build Real Systems.**\n\n*From theory to implementation - CPU scheduling algorithms in C++* ⚙️\n\n[![GitHub](https://img.shields.io/badge/Follow-ADolbyB-blue?style=for-the-badge\u0026logo=github)](https://github.com/ADolbyB)\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadolbyb%2Fprocess-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadolbyb%2Fprocess-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadolbyb%2Fprocess-scheduler/lists"}