Two Threads Executing Two Independent Processors Data Stored Address P Initalized Value 5 Q13517769

Two threads are executing on two independent processors. Thedata stored at address ‘p’ is initalized to the value 5 and thedata stored at address ‘q’ is initialized to the value 6 before thethreads begin executing. Note that SW R0, 0(q) stores the valuezero at address ‘q’. After both threads complete execution, is thestate where the data stored at address ‘p’ contains the value 31and the data stored at address ‘q’ contains the value 10 asequentially consistent execution?

Thread 1 Thread 2
LW R1, 0(q) ADDI R3, R0, 30
ADDI R1, R1, 1 SW R3, 0(p)
LW R2, 0(p) SW R3, 0(q)
ADD R2, R2, 5
SW R1, 0(p)
SW R2, 0(q)
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *