Question

In: Computer Science

20. Suppose we run program P in a computer system using the Linux operating system. We...

20. Suppose we run program P in a computer system using the Linux operating system. We use the Linux time command
to collect some time measurements while P is running. The output from time is,

real.       53m27 .589s
user      24m41 .850s
system 1m3 .337s

a. What was the execution time of P?
b. What was the user CPU time of P?
c. What was the system CPU time of P?
d. How much time during the execution of P did the system spend not executing the instructions of P nor OS in-
structions on behalf of P?
e. List and describe one factor or component of the time from exercise d, i.e., name one thing the system might have
been doing during this time period

Solutions

Expert Solution

**The total execution time of a program means the total time of the CPU used for executing the commands of the program or the kernal commands(System calls) on behalf of the program.
When the normal instructions are performed the user CPU time is utilized and when system calls are executed system CPU time is utilized.
Thus Total Execution time is the sum of the user time and system time.

a)Execution time of P= User CPU time+System CPU time
                     =24m41.850s+1m3.337s
                     =25m45.187s.

b)User CPU time of P is the time spent by CPU for performing program instructions.
i.e 24m41.850s


c)System CPU time of P is the time spent by CPU for performing system calls on behalf of P.
i.e 1m3.337s


d)The Real time represents the actual time elapsed by the clock from the starting of Execution of P to the Completion of Execution of P. Which could include the Actual exection time of P and the Waiting of P.
When P is executed on single CPU the real time will always be greater than the actual execution time.

So,during the execution of P, the time of system spend not executing the instructions of P nor OS instructions on behalf of P will be
real time-Execution time
i.e 53m27.589s - 25m45.187s.
    =3207.589s- 1545.187s
    =1662.402s
    =27m 42.402s

e)
----The P must have beeen waiting for the I/O resources to be available, during which the CPU may be executing other process which is ready to Executed. During this the CPU loads another program in to memory and execute it.

----P may have been send to sleep as a high priority task is requested to the CPU.


Related Solutions

Operating system How do I run a program about processces and IPC on linux can someone...
Operating system How do I run a program about processces and IPC on linux can someone show me an example and the step by step way of doing it. I have files tha were given and I need to run them. Thank you
application that uses linux operating system amd justify the linux operating system. provide a suitable application...
application that uses linux operating system amd justify the linux operating system. provide a suitable application that uses linux os and justify the usage of linux os in the considered application.
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice. [Limitations...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice.
Study PC operating system such as windows and linux etc and mobile operating system such as...
Study PC operating system such as windows and linux etc and mobile operating system such as Android and iOS, find out whether there are functions and features that are provided in PC OS but not in mobile OS, and if there is any, analyze why these functions and features are not provided by these mobile OS. In your opinion for the future development will PC operating system and mobile operating system be the same or different? Give the details.
Differences Between Linux and Windows Operating Systems Two key differences between a Linux operating system and...
Differences Between Linux and Windows Operating Systems Two key differences between a Linux operating system and a Windows operating system are the concepts of “mounting” and “drive” letters. Provide an example for each. Why is it important to plan disk partitioning before installing Linux? Discuss the advantages of disk partitioning. Also discuss what logical volume management (LVM) is and why or why you might use it.
Lab – Linux Fundamentals Instructions: Using Kali Linux, the Windows Linux Sub-System, or another Debian based...
Lab – Linux Fundamentals Instructions: Using Kali Linux, the Windows Linux Sub-System, or another Debian based Linux distribution, perform the following tasks based on the Linux Fundamentals lecture. For this lab, take screenshots for all major steps completed to illustrate that each task was successfully completed (the same method as would be used for other labs). 9. Display your current directory in the terminal 10. Display your current directories contents including the inode value and permissions for each file and...
Pertaining to the Linux operating system, which is a variant of Unix, DISCUSS Topics that will...
Pertaining to the Linux operating system, which is a variant of Unix, DISCUSS Topics that will include things such as history, Linux kernel, and design principles.
Suppose the economy is operating in long-run equilibrium and a positive demand shock hits. We expect...
Suppose the economy is operating in long-run equilibrium and a positive demand shock hits. We expect a short-run increase in real GDP and the price level and a long-run _____ in real GDP (in comparison to the then short run GDP) and _____ the price level (in comparison to the then short run price level). increase; decrease decrease; increase increase; increase decrease; decrease Changes in aggregate demand can be caused by changes in: business costs. raw materials costs. the expenses...
UNIX/LINUX LAB (1) Review the sample shell program (tryShell.c), and compile/run the program (tryShell) with the...
UNIX/LINUX LAB (1) Review the sample shell program (tryShell.c), and compile/run the program (tryShell) with the following commands, and at the end, use CTRL+C to terminate the program: ls ls -l tryShell* date whoami hostname uname -a ctrl+C    (2) Run the program (tryShell) with "time -p" with a few commands: time -p ./tryShell (3) Edit the program (tryShell.c) so that it will exit (terminate the program) when the input command string is "exit" try shell.c code at bottom //////////// #include...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT