Question: When multiple tasks are executed on a single - threacted cpu, the tasks are shechuled boved on the prenciple of pre emption. When a higher
When multiple tasks are executed on a single
threacted cpu, the tasks are
shechuled boved on the prenciple of pre emption. When a higher priority tas
There are
functions to be executed on a single
threaded CPU, with each function
having a unique ID between o and
Given an integer
representing the
numberefthetions to toe executed, and an execution log as an array of strings,
focx of size m determine the exclussive times of each of the functions. Exclusive
time is the sum of execution times for all calls to a function. Any string representing
an execution log is of the form
function
d
: rstart
end
:
timestamp
indicating
that the function wath io f fmetion id elther starts or ends at a time identified by
the cimestamp walue.
Note: While calculating the execution time of a function call, both the starting and
ending times of the function call have to be included. The log of the form
trunction todystarde:
timestamp
means that the running function is preempted at
the beginning of timestamp second. The log of the form
function
id
:
end
:
frimestampl means that the function function id is preempted after completing its
execution at timestamp second i
e after timestamp second.
Example
Suppose
logs
:start:
:start:
:start:
O
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
