https://github.com/israel-charles/the-multi-process-scheduler
This project uses Python to implement and simulate 4 process scheduling algorithms: FIFO, Preemptive SJF, Round Robin, and Lottery Scheduler. The script will read process data from an input file, execute the scheduling algorithms, calculate turnaround, waiting, and response times, and output the results to a file.
https://github.com/israel-charles/the-multi-process-scheduler
fifo-scheduler lottery-scheduler preemptive-scheduling preemptive-sjf process-scheduling-algorithms python round-robin-scheduler sjf-scheduling
Last synced: 2 months ago
JSON representation
This project uses Python to implement and simulate 4 process scheduling algorithms: FIFO, Preemptive SJF, Round Robin, and Lottery Scheduler. The script will read process data from an input file, execute the scheduling algorithms, calculate turnaround, waiting, and response times, and output the results to a file.
- Host: GitHub
- URL: https://github.com/israel-charles/the-multi-process-scheduler
- Owner: Israel-Charles
- Created: 2024-05-19T23:08:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-15T20:16:42.000Z (9 months ago)
- Last Synced: 2025-01-18T04:24:37.908Z (4 months ago)
- Topics: fifo-scheduler, lottery-scheduler, preemptive-scheduling, preemptive-sjf, process-scheduling-algorithms, python, round-robin-scheduler, sjf-scheduling
- Language: Python
- Homepage: https://codepad.site/pad/0d81xqp1
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The-Multi-Process-Scheduler
This software implements 4 process scheduling algorithms: FIFO (First In, First Out), Pre-emptive Shortest Job First (SJF), Round Robin (RR), and Lottery Scheduler. The implementation should be able to simulate the scheduling of multiple processes under each algorithm and calculate their turnaround time, response time, and wait time. The following key components are required:- Process Data Structure: Representing each process with its arrival time, execution time, and status.
- Scheduler Functions: One function for each algorithm to handle a list of processes and implement the respective scheduling logic.
- Time Slice Parameter: A Q-value for the Round Robin algorithm to determine the maximum time a process can run before being preempted.
- Metric Calculation Functions: Functions to compute turnaround time, waiting time, and response time for each process.#### Demo > https://codepad.site/pad/0d81xqp1
### To Run the Program
*Note that the final file includes all the depencies in one file*
*Some test input files can be found in the Test_Files Folder*
```
python3
```### Input File Format
The input file will have the following format:
```
processcount
runfor
use [quantum### Output File Format
The output file will document the events and results as follows:
```
processes
Using
[Quantumwait turnaround response
...
[ did not finish (if there is a process that did not finish within the allocated time)]
...
```## Some Error Handling
Handled gracefully with specific messages:
- Missing parameter: "Error: Missing parameter "
- Missing quantum for Round Robin: "Error: Missing quantum parameter when use is 'rr'"
- No input file: "Usage: scheduler-gpt.py "