Shared Bounded Buffer (Size = 5)shared_count = 3
Producer Thread
count = count + 1
idle
producer.asm
1LOAD Rp, count
2INC Rp
3STORE Rp, count
Private Register
Rp
—
Consumer Thread
count = count - 1
idle
consumer.asm
1LOAD Rc, count
2DEC Rc
3STORE Rc, count
Private Register
Rc
—
What Are We Watching?Step 1 of 14
Welcome to Episode 5. We have a shared buffer with 3 items. A Producer thread wants to add an item, and a Consumer thread wants to remove one.