Answered step by step
Verified Expert Solution
Question
1 Approved Answer
THE ABSTRACTION: THE PROCESS 1 2 Homework ( Simulation ) This program, process - run. py , allows you to see how process states change
THE ABSTRACTION: THE PROCESS
Homework Simulation
This program, processrun. py allows you to see how process states change as programs run and either use the CPU eg perform an add instruction or do IO eg send a request to a disk and wait for it to complete See the README for details.
Questions
Run
processrun.py with the following flags: :: What should the CPU utilization be eg the percent of time the CPU is in use? Why do you know this? Use the and flags to see if you were right.
Now run with these flags: processrun.py :: These flags specify one process with instructions all to use the CPU and one that simply issues an IO and waits for it to be done. How long does it take to complete both processes? Use and to find out if you were right.
Switch the order of the processes: :: What happens now? Does switching the order matter? Why? As always, use and to see if you were right
We'll now explore some of the other flags. One important flag is which determines how the system reacts when a process issues an IO With the flag set to SWITCHONEND, the system will NOT switch to another process while one is doing IO instead waiting until the process is completely finished. What happens when you run the following two processes SWITCHONEND one doing IO and the other doing CPU work?
Now, run the same processes, but with the switching behavior set to switch to another process whenever one is WAITING for IO :: SWITCHONIO What happens now? Use and p to confirm that you are right.
One other important behavior is what to do when an IO completes. With I IORUNLATER, when an IO completes, the process that issued it is not necessarily run right away; rather, whatever was running at the time keeps running. What happens when you run this combination of processes? processrun.py :::: SWITCHONIO c p I IORUNLATER Are system resources being effectively utilized?
Now run the same processes, but with I IORUNIMMEDIATE set, which immediately runs the process that issued the IO How does this behavior differ? Why might running a process that just completed an IO again be a good idea?
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