Two threads (A and B) are concurrently running on a dual-core processor that implements a sequentially consis- tent memory model. Assume that the value at address (R10) is initialized to 0. The instruction st immediate, (R10) writes an immediate number into the memory address stored in R10. Thread A (core 1) 1: st 0x1, (R10) 2: ld R1, 3: st 0x2, 4: ld R2, (R10) (R10) (R10) Thread B (core 2) 1: st 0x3, (R10) 2: ld R3, (R10) 3: st 0x4, (R10) 4: ld R4, (R10) After both threads have finished executing, you find that (R1, R2, R3, R4) = (1, 2, 3, 4). How many different instruction interleavings of the two threads produce this result (please show all possible interleavings)?

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter11: Operating Systems
Section: Chapter Questions
Problem 21VE
icon
Related questions
Question
Two threads (A and B) are concurrently running on a dual-core processor that implements a sequentially consis-
tent memory model. Assume that the value at address (R10) is initialized to 0. The instruction st immediate,
(R10) writes an immediate number into the memory address stored in R10.
Thread A (core 1)
1: st 0x1, (R10)
2: ld R1, (R10)
3: st 0x2,
ld R2,
(R10)
4:
(R10)
Thread B (core 2)
1: st 0x3, (R10)
2: ld R3, (R10)
3: st 0x4,
(R10)
4: ld R4, (R10)
After both threads have finished executing, you find that (R1, R2, R3, R4) = (1, 2, 3, 4). How many different
instruction interleavings of the two threads produce this result (please show all possible interleavings)?
Transcribed Image Text:Two threads (A and B) are concurrently running on a dual-core processor that implements a sequentially consis- tent memory model. Assume that the value at address (R10) is initialized to 0. The instruction st immediate, (R10) writes an immediate number into the memory address stored in R10. Thread A (core 1) 1: st 0x1, (R10) 2: ld R1, (R10) 3: st 0x2, ld R2, (R10) 4: (R10) Thread B (core 2) 1: st 0x3, (R10) 2: ld R3, (R10) 3: st 0x4, (R10) 4: ld R4, (R10) After both threads have finished executing, you find that (R1, R2, R3, R4) = (1, 2, 3, 4). How many different instruction interleavings of the two threads produce this result (please show all possible interleavings)?
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Terminal Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning