Question: [ Bonus 6 points ] Consider the following program ( the included headers are removed to save space ) . There are exactly four different
Bonus points Consider the following program the included headers are removed to save space There are exactly four different possible values at Line A Fill in the four blanks all the four possible values in the increasing order.
x ;
pthreadmutext lock;
void increasevoid arg
pthreadmutexlock&lock;
x ;
pthreadmutexunlock&lock;
printfd
x; A
main
pidt pid;
pthreadt t t;
int y ;
pid fork;
if pid
x ;
y ;
pthreadcreate&t NULL, increase, NULL;
pthreadcreate&t NULL, increase, NULL;
pthreadjoint NULL;
pthreadjoint NULL;
return ;
else
x ;
y ;
pthreadcreate&t NULL, increase, NULL;
pthreadcreate&t NULL, increase, NULL;
pthreadjoint NULL;
pthreadjoint NULL;
return ;
Line A: Smallest Possible Value
type your answer...
Line A: nd Smallest Possible Value type your answer...
Line A: rd Smallest Possible Value type your answer...
Line A: Largest Possible Value
type your answer...
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
