in Operating System edited by
2,342 views
20 votes
20 votes

Consider the program 

P:: x:=1; y:=1; z:=1; u:=0

And the program

Q:: x, y, z, u := 1, 1, 1, 1; u:= 0

Which of the following is true?

  1. P and Q are equivalent for sequential processors.
  2. P and Q are equivalent for all multi-processor models.
  3. P and Q  are equivalent for all multi-core machines.
  4. P and Q are equivalent for all networks of computers.
  5. None of the above
in Operating System edited by
2.3k views

1 comment

Question :- why A,B and C options are wrong?

Answer :- Try to see programs P and Q from processor's (or machine's) point of view. As we know that processor or machine understand programs in form of 0's and 1's. So, P and Q are different programs for them.

0
0

1 Answer

14 votes
14 votes
Best answer
Both the programs are equivalent in the sense that the output will be the same at the end of execution. Q just writes 1 to u but this will be overwritten by the following write of 0. So, in any computer both P and Q should produce the same result at the end of execution.

Correct Answer: $D$
edited by
by

4 Comments

little difference.

in multiprocessor system , processors may belong to different vendors while in multicore , cores would belong to same vendor.Another point is multicore shares cache while multiprocessor system doesn't.

https://superuser.com/questions/13107/whats-the-difference-between-multicore-proc-and-multiproc-system

3
3

@ankitgupta.1729

@Satbir

@techbd123

I feel all options are true in this case. (I mean A, B, C and D)

 

0
0

Option D encapsulates Options A,B and C.

2
2
Answer:

Related questions