while(1) {while (((in+1)%BUFFER-SIZE) ==out) buffer[in]=nextproduced;in=(in+1)%BUFFER-SIZE;}这个算法要怎么修改使之能用到n个进程?

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 17:33:03
while(1){while(((in+1)%BUFFER-SIZE)==out)buffer[in]=nextproduced;in=(in+1)%BUFFER-SIZE;}这个算法要怎么修改使之能

while(1) {while (((in+1)%BUFFER-SIZE) ==out) buffer[in]=nextproduced;in=(in+1)%BUFFER-SIZE;}这个算法要怎么修改使之能用到n个进程?
while(1) {while (((in+1)%BUFFER-SIZE) ==out) buffer[in]=nextproduced;in=(in+1)%BUFFER-SIZE;}
这个算法要怎么修改使之能用到n个进程?

while(1) {while (((in+1)%BUFFER-SIZE) ==out) buffer[in]=nextproduced;in=(in+1)%BUFFER-SIZE;}这个算法要怎么修改使之能用到n个进程?
{ whicle(((in 1)%BOFFER_SIZE==out);/*do nothing*/ buffer[in{ while(available){ try{wait(); }catch(InterruptedException e){} }