Skip to content

dvfens/os-cpu-scheduling-simulator-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python OS Scheduler Simulator

A Python-based simulator that implements core Operating System CPU Scheduling Algorithms.
This project demonstrates practical understanding of process scheduling, ready queues, preemption, and performance metrics using clean and modular code design.


πŸ“Œ Features

  • Implements major CPU Scheduling Algorithms:
    • First Come First Serve (FCFS)
    • Round Robin (RR)
    • Shortest Job First (SJF)
    • Shortest Remaining Time First (SRTF)
    • Priority Scheduling
    • Preemptive Priority Scheduling
  • Accurate simulation of OS-level process execution
  • Efficient ready queue management using appropriate data structures
  • Calculation of key scheduling metrics:
    • Completion Time
    • Turnaround Time
    • Waiting Time
  • Modular and extensible project structure
  • Easy to add new algorithms or enhancements

🧠 Concepts Covered

  • Operating Systems (CPU Scheduling)
  • Process Management
  • Preemption & Time Quantum
  • Ready Queue Simulation
  • Data Structures (deque, lists)
  • Algorithmic Time Complexity
  • Clean Code & Modular Design

πŸ“‚ Project Structure

python-os/
β”œβ”€β”€ algorithms/
β”‚   β”œβ”€β”€ fcfs.py
β”‚   β”œβ”€β”€ round_robin.py
β”‚   β”œβ”€β”€ sjf.py
β”‚   β”œβ”€β”€ srtf.py
β”‚   β”œβ”€β”€ priority.py
β”‚   β”œβ”€β”€ preemptive_priority.py
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ process.py
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ main.py
└── README.md

βš™οΈ Technologies Used

  • Language: Python
  • Core CS: Operating Systems, Data Structures & Algorithms
  • Tools: Git, GitHub

πŸš€ How to Run

  1. Clone the repository:
    git clone <your-repo-link>

2.Navigate to the project directory:

   cd python-os

3.Run the main file:

   python main.py

πŸ“Š Output

The simulator outputs:

Execution order of processes

Completion Time

Turnaround Time

Waiting Time

This helps in visualizing and comparing scheduling algorithms.

πŸ“š Learning Outcome

This project strengthened my understanding of Operating System internals, particularly how CPU scheduling works in real systems, while applying DSA concepts in Python.

About

A Python-based simulator that demonstrates and compares core CPU scheduling algorithms used in Operating Systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages