Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Department of Computing: CLO4 (Design & Implement Various Pieces of OS Software)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Department of Computing

CS 330: Operating Systems

Lab 6: Process Scheduling

CLO4(Design & implement various pieces of OS software)

Time: 9.00 AM – 12:00 PM and 02:00 PM – 05:00 PM

Instructor: Dr. Pakeeza Akram


Lab 6: Process Scheduling

Introduction

The process scheduling is the activity of the process manager that handles the removal of the
running process from the CPU and the selection of another process on the basis of a particular
strategy.
Process scheduling is an essential part of a Multiprogramming operating systems. Such
operating systems allow more than one process to be loaded into the executable memory at a
time and the loaded process shares the CPU using time multiplexing.

Objectives

The purpose of this lab is to introduce the concept of process scheduling and let the study get
the hands on experience on writing process scheduling code for themselves

Tools/Software Requirement

Linux OS installed on laptops or systems.

Description

A Process Scheduler schedules different processes to be assigned to the CPU based on particular
scheduling algorithms. There are six popular process scheduling algorithms which we discussed in class

● First-Come, First-Served (FCFS) Scheduling
● Shortest-Job-Next (SJN) or Shortest Job First Scheduling
● Shortest Remaining Time
● Priority Scheduling
● Round Robin(RR) Scheduling
● Multiple-Level Queues Scheduling

These algorithms are either non-preemptive or preemptive. Non-preemptive algorithms are


designed so that once a process enters the running state, it cannot be preempted until it
completes its allotted time, whereas the preemptive scheduling is based on priority where a
scheduler may preempt a low priority running process anytime when a high priority process
enters into a ready state.

Priority Based Scheduling


● Priority scheduling is a non-preemptive algorithm and one of the most common
scheduling algorithms in batch systems.
● Each process is assigned a priority. Process with the highest priority is to be executed
first and so on.
● Processes with the same priority are executed on a first come first served basis.
● Priority can be decided based on memory requirements, time requirements or any other
resource requirement.

Round Robin Scheduling


● Round Robin is the preemptive process scheduling algorithm.
● Each process is provided a fix time to execute, it is called a quantum.
● Once a process is executed for a given time period, it is preempted and other process
executes for a given time period.
● Context switching is used to save the states of preempted processes.

Tasks

Following are the few tasks to perform.

Task 1:

Create a C code for priority scheduling. Working in the following manner. The program asks the
user to give the total number of jobs. User also provide the job ID, Burst time and the priority.
For each job compute the following: Calculate response time of each process and also compute
the turnaround time, Finish time and waiting time for each process. At the end, the program
should also compute the average waiting time as well. Also show and represent any kind of
Gantt Chart for the algorithm.

Task 2:

To implement Round Robin CPU scheduling algorithm. The program should ask for the list
of processes and their arrival time and burst time. It also ask the user for quantum time. Do
the round robin scheduling and provide the finish time, waiting time, turnaround time and at
the end also show the list of all processes in any form of Gantt Chart.

Deliverables:

C code with all instructions to execute the code.

You might also like