Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Scheduling Algorithms

C++ console simulations for common CPU scheduling algorithms studied in Operating Systems coursework. Each program generates process arrival and burst times, prints the scheduling table, calculates average turnaround and waiting time, and displays a simple Gantt chart in the terminal.

Algorithms

  • First-Come, First-Served (FCFS)
  • Shortest Job First (SJF)
  • Round Robin (RR)

Project Files

.
├── FCFS.cpp
├── SJF.cpp
├── RR.cpp
└── README.md

Build

Each file is standalone and can be compiled separately with any C++17-compatible compiler.

Using g++:

g++ -std=c++17 FCFS.cpp -o fcfs
g++ -std=c++17 SJF.cpp -o sjf
g++ -std=c++17 RR.cpp -o rr

Using Microsoft Visual C++ from a Developer PowerShell:

cl /EHsc FCFS.cpp /Fe:fcfs.exe
cl /EHsc SJF.cpp /Fe:sjf.exe
cl /EHsc RR.cpp /Fe:rr.exe

Run

./fcfs
./sjf
./rr

On Windows PowerShell:

.\fcfs.exe
.\sjf.exe
.\rr.exe

Round Robin asks for both the number of processes and the time quantum. FCFS and SJF ask for the number of processes.

Notes

  • Process arrival times and burst times are generated randomly in the range 1 to 10.
  • The repository keeps only the clean standalone source files. Visual Studio cache folders, build outputs, and duplicate local project folders are ignored.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages