Question: bjective This assignment will introduce you to process scheduling. SPECIfications You are to simulate the execution of a stream of interactive processes by a time
bjective
This assignment will introduce you to process scheduling.
SPECIfications
You are to simulate the execution of a stream of interactive processes by a timeshared system with a very large RAM, a multicore processor, and an SSD
For simulation purposes, we will assume that each process consists of a fixed number of process steps known a priori and will be executed sequentially in the order specified.
Input Format: Your program should read its input from stdin C cin and use input redirection as in:
$ assignment inputtxt
This input will look like:
Each process will execute each of its computing steps one by one and in the specified order. In addition, all process start times will increase monotonically.
CPU Allocation: Your program should maintain two separate ready queues, namely
A highpriority queue for new processes and processes that have completed a USER request, and
A lowpriority queue for processes having completed an SSD request.
Both queues should use FirstCome FirstServed FCFS policy. When a busy CPU becomes available and processes are waiting, the scheduler should look first for processes in the highpriority queue and only pick a process from the lowpriority queue when the highpriority queue is empty.
SSD requests: Your program should maintain a single FCFS queue for all processes accessing the SSD
USER requests: We will assume that each user runs a single interactive process at a time. As a result, USER requests will never be queued.
Memory Allocation: We assume the system memory is large enough to contain all processes.
Required Outputs: Each time a process terminates, your program should output a short report with:
The total simulated time elapsed;
The start time of the terminating process, the number of milliseconds of processor time it has used since it started, as well as the number of SSD accesses and USER interactions it performed;
For each process in main memory and the process that has just terminated, one line with the sequence number of the process, and its current status READY RUNNING, BLOCKED, or TERMINATED;
Error recovery: Your program can assume that its inputs will always be correct.
Implementation
Your program must start with a block of comments containing your name, the course number, and so on It should contain functions and these functions should have arguments.
One process table should contain all processes loaded into the main memory and not yet terminated. This table should be used to keep track of process statuses and should be distinct from the data structures that you might use to store your input data.
Since you are to focus on the scheduling actions taken by the system you are simulating, your program will only have to act when a process starts or completes a computational step.
Whenever two or more of these events occur at the same time, your program should process first the CPU step completions then the SSD access completion, then the user interaction completion, and finally the process arrival.
All times should be simulated.
If possible, please submit your assignment in a single file named either FirstNameLastNamec or FirstNameLastNamecpp
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
