You are on page 1of 4

College of Computer and Information Sciences

Department of Computer Science


Operating System COURSE PROJECT CIS 342
First Semester (1445-2023)

• During this course, you have to develop and program a project on CPU
scheduling algorithms

• You need to make a team consisting of 5 students ( Two groups will have 6
students).

• Start the Work to Be ready on Time (Week 13, 28-04-1445)

• During the semester, make sure you meet the deadline for the project.

• You can use any programming languages such as Java, or C++ for the
implementation.

• Prepare a presentation to explain the details of your project with


maximum 10-15 minutes per group. Presentations will be held in week 14
-15

• Project is worth 10 marks [ 5 implementation + 5 presentation]


Project: CPU Scheduling Algorithms
Objective
One of the most important jobs of a modern operating system is managing the
various processes in the system. The goal of any management scheme should be
to provide a low system response time and high overall throughput of jobs. The
policy should also prevent starvation, be fair to the various processes, and
efficiently utilize the systems resources. Obviously, some scheduling policies are
better at achieving these goals than others. In this project, you will investigate
four different scheduling algorithms and their effects on the average waiting time,
average turn round time, and fairness.
Project Description
Your mission is to design and implement four different schedulers. These include:
• First-Come, First-Serve (FCFS) scheduler
• Shortest Job First non-preemptive (SJFnp) scheduler
• Shortest Job First preemptive (SJFp) scheduler
• Round-Robin (RR) scheduler
A description of what each of these schedulers should do is listed in the following
table. It is recommending that you try to implement the schedulers in the order
they are listed.

This scheduler does exactly what it says - jobs are scheduled in the
FCFS order that they appear to the scheduler. This policy will never
preempt the currently running job.

This scheduler should return the Job that will have the shortest
CPU burst. To implement this and the next technique (i.e. SJFp),
you are allowed to "cheat" to determine the shortest CPU burst.
Simply call the burst Remaining () method for each Job object in the
SJFnp queue. Burst Remaining () returns the amount of time left for a
particular jobs CPU burst. This method basically allows you to look
into the future. In a real system, you would not have access to this
information. This policy will never preempt the currently running
job.
This is exactly like the previous technique (SJFnp) except it is even
more aggressive in scheduling jobs. If a new job is added to the
system whose next CPU burst is less than the time remaining on
SJFp
the current jobs burst, the new Job should be scheduled. To make
this happen, you add method should return true if the new Job has
a shorter burst than the current Job. Be careful, though, to make
sure that you compare the new jobs burst time to that remaining on
the current jobs (as opposed to the total burst time for the current
job). This policy will occasionally preempt the currently running job.
This scheduler does exactly as the following, first have a queue
where the processes are arranged in first come first serve order. A
quantum value is allocated to execute each process. The first process
RR is executed until the end of the quantum value. After this, an
interrupt is generated and the state is saved. The CPU then moves
to the next process and the same method is followed. Same steps are
repeated till all the processes are over.

Input file
You can use any input file for a trace of actual process activity on a real system
for 10 processes. Suppose we have an input file as the following schedule that
contains 2 columns.
The first column is the time when a particular process enters the system (arrival
time). The second column shows how long the process needs to run on the
processor (burst time).

P# Arrival Time Burst Time


1 1 3
2 1 10
3 2 4
4 3 5
5 4 6
6 5 2
7 6 2
8 6 9
9 7 4
10 9 3

Project Report
For this project you will be required to write a brief report discussing what you
have learned about scheduling policies. You should run the following 7
experimental:
• Round-Robin with Quantum equal to zero.
• Round-Robin with Quantum equal to 10.
• Round-Robin with Quantum equal to 100.
• Round-Robin with Quantum equal to 10000.
• First-Come, First-Serve.
• Shortest Job First Non-Preemptive.
• Shortest Job First Preemptive.
Your report should include such things as why different schedulers perform the
way they do, the effects of different length quantum on a Round-Robin scheduler,
the effects of preemptive versus non-preemptive scheduling. The comparison
between average waiting time for all algorithms.
Additional information about your report
Include the names of each partner on the first page of the report. A softcopy of
your report and program should be placed in Blackboard. Your report should be
approximately 7-pages long. Be brief and concise.

You might also like