Module 20: Multi-core Computing Multi-processor Scheduling
  Lecture 40: Multi-core Computing Synchronization
 


Anatomy of Downloading Window

The Producer-Consumer Problem

Produce(item_t item) {
while (count==bufsz);
buffer[in]=item;
in=(in+1)%bufsz;
count=count+1;
}
Consume(item_t *item) {
while(count==0);
*item=buffer[out];
out=(out+1)%bufsz;
count=count-1;
}
Shared Variables
 
  buffer, count