192 views
0 votes
0 votes

1 Answer

1 votes
1 votes
There are various cases possible that are as follows

a) Say P execute First and then Q (All statement of P are one after one and same to that of Q) here we have a=8 and b=4;

b)Say Q execute First and then P(same as above ) here we have a=2 and b=6;

c)Say P execute its 1st stmt then Q his 1st then P his 2nd then Q his second..here we have a=8 and b=6;

d) Say P his 1st then Q his 1st and 2nd then P his 2nd here we have a=8 and b=12..

e)Say Q execute its 1st stmt then P his 1st then Q his 2nd then P his second..here we have a=8 and b=12;..

So all aboves are possible out cotcomes if we Run the program in parrallel case as per given Conditions..

f)Say Q his 1st then P his 1st and 2nd then Q his 2nd here we have a=8 and b=6

Related questions

1 votes
1 votes
2 answers
1
1 votes
1 votes
1 answer
2