Question
In C++ , please demonstrate me a code that simulates core scheduling. Each process will be described by its start time and its process id
In C++, please demonstrate me a code that simulates core scheduling. Each process will be described by its start time and its process id followed by a sequence of resource requests. These resources requests will include core requests (CORE), SSD requests (SSD) and user interactions (TTY). Your input will be a sequence of pairs as in: NCORES 2 // number of cores START 12000 // new process PID 23 // process ID CORE 100 // request CORE for 100 ms TTY 5000 // 5000 ms user interaction CORE 80 // request CORE for 80 ms SSD 1 // request SSD for 1 ms CORE 30 // request CORE for 30 ms SSD 1 // request SSD for 1 ms CORE 20 // request CORE for 20 ms START 12040 // new process ... END // end of data
-The program should have two ready queues, namely: 1. A interactive queue that contains all processes have just completed a user interaction, 2. A non-interactive queue that contains all other processes waiting for a core.
-Both ready queues should be FIFO queues and SSD scheduling will be strictly first-come first-served
This is what I've decided to start on to read the txt files for the sequence of pairs.
#includeusing namespace std; int main() { string keyword; int num; while(cin>>keyword>>num){ cout< When all the processes in the input stream have completed, the simulator should print a summary report listing: 1. The total simulation time n millisecond, 2. The number of processes that have completed, 3. The total number of SSD accesses,
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