Answered step by step
Verified Expert Solution
Link Copied!

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
12
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
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.
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.
Switch the order of the processes: -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)
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 process while one is doing I/O, instead waiting until the process is completely finished. What happens when you run the following two processes ?-c-S SWITCH_ON_END), one doing I/O 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 I/O (-11:0,4:100-c-S SWITCH_ON_IO). What happens now? Use -c and -p to confirm that you are right.
One other important behavior is what to do when an I/O completes. With -I IO_RUN_LATER, when an I/O 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? (./process-run.py -13:0,5:100,5:100,5:100-S SWITCH_ON_IO -c -p - I IO_RUN_LATER) Are system resources being effectively utilized?
Now run the same processes, but with -I IO_RUN_IMMEDIATE set, which immediately runs the process that issued the I/O. How does this behavior differ? Why might running a process that just completed an I/O again be a good idea?
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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions