Home / Expert Answers / Computer Science / concurrency-consider-the-following-processes-p1-and-p2-that-update-the-value-of-the-shared-variable-pa877

(Solved): Concurrency Consider the following processes P1 and P2 that update the value of the shared variable ...



student submitted image, transcription available below
Concurrency Consider the following processes P1 and P2 that update the value of the shared variables, and , as follows: Process P1: ( performs the operations: ) LOAD R1, LOAD R2, Y // (B) MUL R1, R2 // (C) STORE X, R1 // (D) INC R2 // (E) STORE Y, R2 // (F) Process P2 : ( performs the operations: ) LOAD R3, X //(G) INC R3 //(H) LOAD R4, Y // (I) MUL R4, R3 // (J) STORE , R3 // (K) STORE Y, R4 //(L) Assume that the initial values of and are 2 and 3 , respectively. Question 1 P1 and P2 execute serially (one after the other without any interleaving or concurrent execution). What would the values of and be after the execution? Answers are separated by a comma, no space. E.g: 2,3 Question 2 and are interleaved and the trace of their execution is the following: What would the values of and be after the execution of all instructions? Answers are separated by a comma, no space. E.g: 2,3


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe