© Alan Burns and Andy Wellings, 2001 procedure take (var I : integer); begin if NumberInBuffer = 0 then wait(itemavailable); end if; I := BUF[base]; base := (base+1) mod size; NumberInBuffer := NumberInBuffer-1; signal(spaceavailable); end take; begin (* initialisation *) NumberInBuffer := 0; top := 0; base := 0 end; The Bounded Buffer A process appending an item will, however, signal this suspended process when an item does become available.
{}