Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer the following five questions Homework (Simulation) This program, process-run.py, allows you to see how process states change as programs run and either use
Please answer the following five questions
Homework (Simulation) This program, process-run.py, allows you to see how process states change as programs run and either use the CPU (e.g., perform an add instruction) or do I/O (e.g., send a request to a disk and wait for it to complete). See the README for details Questions 1. Run process-run.py with the following flags:-1 5:100,5:100. What should the CPU utilization be (e.g, the percent of time the CPU is in use?) Why do you know this? Use the -c and -p flags to see if you were right. 2. Now run with these flags: ./process-run.py -1 4:100,1:0. These flags specify one process with 4 instructions (all to use the CPU), and one that simply issues an I/O and waits for it to be done. How long does it take to complete both processes? Use -c and -p to find out if you were right 3. Switch the order of the processes: ./process-run.py -1 1:0,4:100. What happens now? Does switching the order matter? Why? (As always use -c and -p to see if you were right) 4. We'll now explore some of the other flags. One important flag is-s, which determines how the system reacts when a process issues an I/O. With the flag set to SWITCH.ON END, the system will NOT switch to another pro- cess while one is doing I/O, instead waiting until the process is completely finished. What happens when you run the following two processes (-1 1:0,4:100-c- SWITCH.ON END), one doing I/O and the other doing CPU work? 5. Now, run the same processes, but with the switching behavior set to switch to another process whenever one is WAITING for I/O (-1 1:0,4:100 -c -S SWITCH ON IO). What happens now? Use -c and -p to confirm that you are right 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