Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Multiple - processor CPU Scheduling Simulation The CPU Scheduler is a key component of any multiprogramming operating system ( OS ) kernel. It is important
Multipleprocessor CPU Scheduling Simulation
The CPU Scheduler is a key component of any multiprogramming operating system OS
kernel. It is important to understand the details of the CPU scheduling in order to fully
comprehend the dynamic behavior of the operating systems.
In this project, you are asked to write some C programs to simulate the following three
CPU scheduling algorithms for a multicore computing system consisting of four
homogeneous CPUs:
FCFS FirstComeFirstServed scheduling.
RR Round Robin scheduling with time quantum q milliseconds, q
milliseconds, and q milliseconds, respectively.
Threelevel feedbackqueue FBQ preemptive scheduling employing queue Q
RR quantum q milliseconds queue QRR quantum q milliseconds and
queue QFCFS as shown in Figure in the textbook. Read the corresponding
text for details about this scheduling algorithm and include in your implementation
the following:
a a process exceeding its time quantum should be preempted and demoted by
placing it into Q if its original queue was Q or into Q if its original queue
was Q
b a process finishing its IO bursts should be promoted by placing it into Q
c a process preempted for servicing a higher priority queue should be placed in
the beginning of its original ready queue
When you implement your simulations, if two or more processes are identical in terms of
scheduling criterion, you should give precedence to the process that has the smallest
process ID PID number.
Based on the given static CPU workload in the CPULoad.dat text file your programs
must perform the necessary simulations and answer all the following questions for each of
the above CPU schedulers:
What is the average waiting time?
What is the average turnaround time?
When does the CPU finish all these processes? What is the average CPU utilization
by this time point? Note that at any time instance, CPU utilization is if all
CPUs are running, if only CPUs are running, for CPUs, for
only CPU, and if no CPU is running.
How many context switches occur in total during the execution? Note that you
should count as context switches only the cases where a process is preempted
during its CPU burst, and not the cases where a process terminates or just finishes
its current CPU bursts and goes to IO
Which process is the last one to finish?
In this project, you need to write three C programs to implement simulations with the above
CPU schedulers. For the FCFS scheduler, put your program in a file named fcfsc for
the RR scheduler in a file named rrc and for the FBQ scheduler in a file named fbqc
When the programs run, they should print the results to the standard output stdout
For this project, you are provided with two helper files schhelpers.c and sch
helpers.h which include C functions for loading data from a CPU load file, for sorting
processes, and for linkedlist based scheduling queue operations. Please read carefully the
comments in the files for better understanding of the helper functions. You are free to
modify the contents of those two files to fit your needs but you are not allowed to change
the file names. You must submit those files as part of your solution even if you make no
content changes.
Data Format
The CPU workload data file CPULoad.dat contains textual data in the following format
all times are in millisecond:
PID Arrivaltime CPUburst#IOburst# CPUburst#IOburst#
eg
The content of the CPULoad.dat file is provided as an example and your programs
should not be limited to it; they should work with any file content as long as it is properly
formatted as explained above.
Submission of Project Part I P
You should submit the file with your C code for the FCFS scheduler fcfsc the two
helper files schhelpers.c and schhelpers.h and your report
reportPpdf
gcc Wall o fcfs fcfsc schhelpers.c
fcfs CPULoad.dat
Make sure that you include the following information please complete as a comment in
the beginning of all your C programs:
Family Name:
Given Name:
Student Number:
EECS Login ID the one you use to access the red server:
YorkU email address the one that appears in eClass:
Your report pages in PDF format should be structured as follows:
A general outline of your understanding of the assigned work.
A clear statement about the assigned workcomponents you believe you have
donecompleted successfully.
A statement about the work you believe you might have not completed successfully
feel free to comment on related problems, if any
Anything else related to your work that you might wish to comment upon.
Please copy the above entries and paste into your report to use as a template wh
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started