1,208 views
1 votes
1 votes

Consider the following sequential code which is executed in a multiprogramming mode by assuming that each statement can execute independently to achieve the concurrency. If any statement dependent on other statements then those statements will be executed in the order.

S1: a = b + c;
S2: x = y + z;
S3: y = a + c
S4: q = y + z
Which of the above statements can execute concurrently at the beginning of execution?

a)S3 and S4

b)S2 and S3

c)S1 and S2

d)S2 and S4

2 Answers

2 votes
2 votes
(c) S1 and S2 can be executed as S2 does not depend on S1.
1 votes
1 votes
I think the answer is d. S1 executes first then S3(which uses value of a to calculate y) and then any of S2 or S4 executes(which use value of y). What is your opinion?

Related questions

0 votes
0 votes
0 answers
3
jayadev asked Jul 2, 2022
347 views
question about concurrency control methods