Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective This assignment will irneduce you so CPU scheduling. Specificatious You are to simulate the execution of processes by a computer system with a large

Objective
This assignment will irneduce you so CPU scheduling.
Specificatious
You are to simulate the execution of processes by a computer system with a large
mensocy, cese terminal per user, a CPU, and one disk drive. Each process will be
described by its class (REaL-TINE or IMTRacTIVE) and its start time followed by a
sequence of resource requests.
These resources requests will inclade CPU requests (CPU), disk reads (DIgK) and
terminal accesses (TTY). In addition, all real-time processes will have a DRADLINX, by
which they must complete.
Your input will be a sequence of pairs as in:
All time will be expeessed in milliseconds.
Your program should maintain sepsate ready queues for real-timse and interactive
processes and give absolute priority to real-time processes over interactive processes:
a) Your scheduler should never allocate the CPU to an interactive process as long as
there are one or more real-time processes in the ready state.
b) When a real-tine process returns to the ready queue and finds that the CPU is
currently allocated to an inseractive process, the scheduler should take the CPU away
from the interactive proess and give it to the real-time process. The pre-empted
process should retum to the end of the ready qucue for inderactive processes. When
this is the case your program should updaxe the duration of the CPU request by
suberacting from the origial duration the time the proess, has already spent in the
runuing state.
Disk scheduling will be strictly first-come fisst-sened (FCFS) without any distinction of
proess classes.
To simplify your life, we will also assume that:
a) there is enough mensory spoce for all processes,
b) context switch times can be neglectod,
c) weer think times are iscloded in the tenvinal access times, and
d) each process reads and writes to a different terminal.
Your program should read its input file name through input redirection as in:
.a.out 1 input. txt
If by accident, two resources allocations need to be made at the same timb, you should
allocate the CPU first thea the disk and then the terminals.
Your program should have one process table with one entry per process coetaining a
process sequence number, the process class, its poocess arrival time and its current satus
(READY, RCRNIVG, WAITING).
It should point out one line of output every time a process starts of temvinates. This line
should inclode the process sequence number, its class and the current simulated time in
millikeconds.
Whea all the processes in your input stream have coupleted, your simulator should point
a sumwary report listing:
a) the number of real-time processes that have completed,
b) the percentage of real-tinse processes that missed their deadline,
c) the number of interactive processes that have completed,
d) the total number of disk accesses,
e) the average duration of a disk access (including the waiting time in the disk queue),
f) the total timse elapoed simoe the start of the first process,
g) the CPU and disk utilizations, that is, the fraction of time the CPU or the disk was
buxy.
Important
Your program should start by a block of oomments containing your name, the
course number, the dac date and a very short description of the assignmeat. It
should coevain functions and these functions should have arguments.
Fach function should start by a very brief description of the task it perfocnes.
Fach variable definition should be followed by a convent describing the function
of the variable.
All numerical constants should be specified using symbolic constants defined at
the begiming of the progran.
All the source code files, executable code files, readme files, and all the
documentation should subenitted electronically through Brightespace.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

is 9-fluorenone para, mono, or ortho?

Answered: 1 week ago

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago