Skip to content

CPU Schedulers using FCFS, SJF, and RR algorithms

Notifications You must be signed in to change notification settings

shwaygrr/CPU-Scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Scheduler Simulation Project

Overview

This project involves the implementation and simulation of three CPU scheduling algorithms: FCFS non-preemptive, SJF non-preemptive, and Round Robin. The primary objective is to gain hands-on experience in OS scheduling through simulation programming.

Project Details

Implemented Scheduling Algorithms

  1. FCFS non-preemptive:
  2. SJF non-preemptive:
  3. Round Robin (non-preemptive):

Assumptions

  1. Processes arrrive at time 0.
  2. Processes dont wait I/O devices.
  3. After /O event, a process moves back to the ready queue.

Running the Simulation

To run the simulation, follow these steps:

  1. Open the main.cpp file in the src directory.

  2. Locate the p_data variable and input your burst sequence for the desired process. For example:

    // main.cpp
    int p_data[] = {
                    {1, 2, 3, 5},
                    {2, 4, 5, 7},
                    {.2, 6, 7},
                    ...
                  };
  3. Save the main.cpp file.

  4. Open the tasks.json file in your Visual Studio Code workspace (.vscode directory).

  5. Ensure that the args property within the "tasks" array looks like the following:

         "args": [
             "-fdiagnostics-color=always",
             "-g",
             "${workspaceFolder}/*.cpp",
             "-o",
             "fileDirname{fileDirname}\\{fileBasenameNoExtension}.exe"
         ],
  6. Save the tasks.json file.

  7. Build and Run

Evaluation and Results

FCFS SJF RR

About

CPU Schedulers using FCFS, SJF, and RR algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages