0% found this document useful (0 votes)
63 views

Department of Computer Science: Compare and Contrast The Common Scheduling Algorithms)

This document provides instructions for a lab assignment on CPU scheduling algorithms in the CS330 Operating Systems course. Students are asked to write C programs implementing the First Come First Serve (FCFS) and Shortest Job First (SJF non-preemptive) scheduling algorithms. The programs should take process details as input, calculate wait times and completion times, and display the results. The objective is to familiarize students with CPU scheduling concepts and basic algorithm implementation. Students must submit a single document containing the source codes and screenshots by the deadline to receive marks for this graded lab.

Uploaded by

Waseem Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Department of Computer Science: Compare and Contrast The Common Scheduling Algorithms)

This document provides instructions for a lab assignment on CPU scheduling algorithms in the CS330 Operating Systems course. Students are asked to write C programs implementing the First Come First Serve (FCFS) and Shortest Job First (SJF non-preemptive) scheduling algorithms. The programs should take process details as input, calculate wait times and completion times, and display the results. The objective is to familiarize students with CPU scheduling concepts and basic algorithm implementation. Students must submit a single document containing the source codes and screenshots by the deadline to receive marks for this graded lab.

Uploaded by

Waseem Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Department of Computer Science

CS330: Operating Systems

CPU scheduling(Part 1)
Compare and contrast the common scheduling algorithms)

Instructor: Dr. Mehdi Hussain

Cs330: Operating systems Page 1


CPU Scheduling (part 1)
Introduction

Practice the basics algorithms of CPU scheduling.

Note:- This lab is in groups of 2.You have to submit a single document per group.

Objective

The Objective of this lab is to familiarize yourself with CPU scheduling and program basic
algorithms related to it.

Tools/Software Requirement

 Linux (Ubuntu)
 GCC

Description:
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.

Task # 1

Write a C program for FCFS CPU scheduling algorithm.


Explanation:
You have to take number of processes and burst time of each process as input from user. Then
you have to calculate wait time and completion time for each process and display it in the form
of a table. At the end you are supposed to calculate average wait time and average completion
time.

HINT: - you can use array of integers to store burst time, wait time and completion time.

Cs330: Operating systems Page 2


Task # 2

Write a C program for SJF (non preemptive) CPU scheduling algorithm.


Explanation:
You have to take number of processes, burst time and arrival time of each process as input from
user. Then you have to calculate wait time and completion time for each process and display it in
the form of a table. At the end you are supposed to calculate average wait time and average
completion time.

HINT: - you can use array of integers to store burst time, wait time and completion time.

Instructions
You are encouraged to use good programming conventions by entering appropriate comments,
using indentations, and using descriptive variable names in your programs

Deliverables
Upload the document containing source codes as well as screenshots on LMS within lab time.

This lab is graded. Min marks: 0. Max marks: 10.

Cs330: Operating systems Page 3


Cs330: Operating systems Page 4

You might also like