in Programming edited by
364 views
3 votes
3 votes

Consider the program

x:=0; y:=0; (r1:=x; r2:=x; y:= if r1 = r2 then 1 ∥ r3:= y; x:= r3)

Note that ∥ denotes the parallel operator. In which of the following cases can the program possibly result in a final state with $r1 = 0; r2 = r3 = 1$.

  1. Such a transformation is not possible in Java.
  2. Such a program transformation is possible in Java.
  3. Possible in Pascal when the compiler appropriately translates the ∥ operator to interleaved pascal statements.
  4. Possible in all sequential programming languages when the compiler appropriately translates the ∥ operator to interleaved statements in the sequential language.
  5. None of the above.
in Programming edited by
364 views

1 comment

I think option (e)..
0
0

Please log in or register to answer this question.

Answer:

Related questions