Monday 27 February 2012

Bounded-Buffer – Producer Process


  item nextProduced;
  while (1) {
  while (((in + 1) % BUFFER_SIZE) == out)
  ; /* do nothing */
  buffer[in] = nextProduced;
  in = (in + 1) % BUFFER_SIZE;
  }

No comments:

Post a Comment