- 2
- 0
- 约1.64千字
- 约 6页
- 2026-02-27 发布于北京
- 举报
监视器PC;intnextin,nextout,
count;charbuffer[[]];condition
notfull,notempty;append(charx)
{if(count==])Cwait(notfull);
buffer[nextin]=x;nextin=(nextin+1)
%n;count++;Csignal(notempty);}
take(charx){if(count==0)
Cwait(notempty);x=
buffer[nextout];nextout=(nextout+1)
%n;count‑‑;Csignal(notfull);}{
count=0;nextin=0;nextout=0
;
MonitorPC;
intnextin,nextout,count;
charbuffer[n];
conditionnotfull,notempty;
append(charx)
{
if(count==n)Cwait(notfull);
buffer(nextin)=x;
nex
原创力文档

文档评论(0)