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.
Kooperativni procesiBoundedBuffer::BoundedBuffer (): head(0), tail(0), count(0) {}void BoundedBuffer::append (Data* d) {while (count==N);buffer[tail] = d;tail = (tail+1)%N;count++;}Data* BoundedBuffer::take () {while (count==0);Data* d = buffer[head];head = (head+1)%N;count--;return d;}40/285