Os Project1
Os Project1
Important
During this course, you have to do one project.
you should follow the rules to implement your project.
Projects
Project 1 (CPU Scheduling Algorithms).
Make a Team
You need to make a team consisting on maximum 6 students.
program language
You can use any programming languages such as Java, or C++ for the implementation.
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
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 order that they
FCFS
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
SJFnp Job object in the 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 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
SJFp
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
RR are arranged in first come first serve order. A quantum value is allocated to execute
each process. The first process is executed until the end of the quantum value. After
Input file
This file is a trace of actual process activity on a real system for 10 processes, 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).
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:
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.