/Process_Scheduler

This program simulates the process scheduler's operation in a multiprocessor system and calculates some related statistics to help improve the overall scheduling system.

Primary LanguageC++

Process Scheduler

Description

  • This program simulates the process scheduler's operation in a multiprocessor system and calculates some related statistics to help improve the overall scheduling system.
  • This program was written in C++ as our second programming project for Cairo University.

Simulation

I. Processes states

  • Early: A process that didn't pass its deadline time.
  • Late: A process that missed its deadline time.
  • RR migration: A process that migrated from an FCFS processor to an RR processor.
  • SJF migration: A process that migrated from an RR processor to an SJF processor.
  • Parent: A process that is a parent of a forked process.
  • Child: A process that was forked in a FCFS processor.

States

II. Input file

Input

III. Simulation

Assumptions
  • A process can encounter more than one state transition in the same timestep.
  • Process Migration and Work Stealing is not applicable for forked processes.
Scheduling algorithms
  • FCFS: First come first serve scheduling algorithm states that the process that requests the CPU first is allocated the CPU first.
  • SJF: Shortest job first scheduling algorithm that selects the waiting process with the smallest execution time to execute next.
  • RR: In Round Robin algorithm the CPU will divide the time for each process given the same time until the entire process in the queue is complete.
  • EDF: Earliest Deadline First is an optimal dynamic priority scheduling algorithm. It assigns priorities to the task according to the absolute deadline.
At each timestep
  • Checks for transitions from the NEW list to the appropriate RDY list.
  • Handle work stealing and process migrations.
  • Move processes requesting I/O from RUN state to BLK list.
  • Move processes that finish IO_D from BLK list to the appropriate RDY list.
  • Move processes that finish execution from RUN state to TRM list.
  • Handle process forking.
  • Handle process killing and orphan processes.
  • Collect statistics for the output file.

Simulation

IV. Output file

Contains the simulation statistics and it can be broken down to two parts:

- Processes statistics :
  1. Average waiting time, response time, and turnaround duration.
  2. FCFS to RR migration and RR to SJF migration.
  3. Early, stolen, forked, and killed processes.
- Processors statistics :
  1. Processors load.
  2. Processors utilization.

Output

Authors

Installation

Clone this repository, Open and run the .sln file.

Environment

This program was built and tested on Visual Studio 2022.