Question: I have a mac so I'm not really able to do this lab, if anyone could help me that would be much appreciated! First program

I have a mac so I'm not really able to do this lab, if anyone could help me that would be much appreciated!

First program is CPU-bound, which means it performs only calculations, whereas, second program is IO-bound, which means it keeps on printing a message to screen. The goal is to differentiate their behavior inside of the operating system and have a better understanding of user mode, kernel mode (aka privileged). ProcessHacker tool will allow you to observe and monitor time that each process spends in user mode in contrast to kernel mode. Source code for each program is provided below for reference:

I/O bound in C++ and Python

CPU bound in C++ and Python

#include

using namespace std;

int main() {

for (;;)

cout << "Omari";

}

int main() {

int x = 0;

for (;;) { x++; }

}

while True: print('Omari')

 
i = 0 while True: i += 1

Steps

  1. Download and install processHacker utility (http://processhacker.sourceforge.net/downloads.php)
  2. (Compile) and run above code, try to run both at the same time
  3. Open ProcessHacker and look for both processes, right-click on each and click on Properties
  4. Observe the following metrics:
    1. Kernel time
    2. User time

Record above metrics once a minute for next 5 minutes. Organize your data in a table.

  1. At the end of the 5 minutes, click on Performance tab, this should show you CPU usage for each process. Take screen shots of both.

Questions

  1. What are the process IDs for both of above processes?
  2. Explain trend of kernel/user time for each process.

Deliverables

  1. Table with kernel time and user time for each process (5 measurements for each)
  2. Answers to Questions 1 and 2 above.
  3. Screenshots of CPU usage of both processes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!