Sunday 11 March 2012

Bounded-Buffer


  • Consumer process
  item nextConsumed;
  while (1) {
  while (counter == 0)
  ; /* do nothing */
  nextConsumed = buffer[out];
  out = (out + 1) % BUFFER_SIZE;
  counter--;
  }
 

No comments:

Post a Comment