In: Computer Science
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
**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.