5. Predavanje - VTS NS
5. Predavanje - VTS NS
5. Predavanje - VTS NS
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
MonitoriPrimer: ograničeni bafer (bounded buffer), nastavakprocedure take (var i : integer);beginwhile numberInBuffer = 0 dowait(itemAvailable);end while;i := buf[base];base := (base+1) mod size;numberInBuffer := numberInBuffer-1;signal(spaceAvailable);end take;begin (* Initialization *)numberInBuffer := 0;top := 0; base := 0end;11/285