Semp mutex 1,mutex2,empty1,empty2,full1,full2; Mutex1=1; Mutex2=1; Empty1=empty2=1; Full1=full2=0; PA() { While(true) { P(empty1); P(mutex1); 将消息放入buf1; V(mutex1); V(full1); } } PB() { While(true);\ { P(full1); P(mutex1); 从buf1复制信息; V(mutex1); V(empty1);