Professional Documents
Culture Documents
Nguyn Hi Chu Khoa Cng ngh thng tin Trng i hc Cng ngh
ng b ha tin trnh
V d ng b ha (1)
Tin trnh ghi P: while (true) { while (counter==SIZE) ; buf[in] = nextItem; in = (in+1) % SIZE; counter++; } buf: Buffer SIZE: c ca buffer counter: Bin chung Tin trnh c Q: while (true) { while (counter==0) ; nextItem = buf[out]; out = (out+1) % SIZE; counter--; }