Question: A = 5 , B = 1 5 , C = 4 5 0 0 4 . Assume the following pseudocode is run by two
A B C
Assume the following pseudocode is run by two threads at approximately the same time on a
single processor machine.
dosomething; takes T unit time to execute T is less than C
mutexlock;
dosomethingelse; takes no time to execute
mutexunlock;
exit; takes no time to execute
Assume also that a simple spin lock is used. The time required for acquiring this lock
mutexlock is A unit time and the time required for releasing it mutexunlock is also A unit
time. Context switch time is B unit time. A thread works at most C unit time before the context
switch happens ie time slice quantum C
a What would be the total completion time of the two threads in the best possible case?
points
b What would be the total completion time of the two threads in the worst possible case?
points
Hint: In both answers, the completion time is equal to a numerical value plus T you do not know hence
do not need to specify the value of T
Note: In your answer, please
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
