第二章进程管理2.试画出下面四条语句的前趋图:S1:a:=x+yS2:b:=z+1S3:c:=a-bS4:w:=c+1第二章进程管理图2-2题四条语句的前趋关系S1S2S3S4第二章进程管理26.试修改下面生产者—消费者问题解法中的错误:第二章进程管理Varmutex,empty,full:semaphore:=1,n,0;buffer:array[0,…,n-1]ofitem;in,out:integer:=0,0;beginparbeginproducer:beginrepeat…produceranitemnextp;…wait(mutex);wait(empty);wait(full);wait(mutex);buffer(in):=nextp;;in:=in+1modn;signal(mutex);;signal(full);untilfalse;end第二章进程管理consumer:beginrepeatwait(mutex);wait(full);wait(empty);wait(mutex);nextc:=buffer(out);out:=(out+1);out:=(out+1)modn;signal(mutex);;signal(empty);consumertheiteminnextc;untilfalse;endparendend第二章进程管理Varmutex,empty,full:semaphore:=1,n,0;buffer:array[0,…,n-1]ofitem;in,out:integer:=0,0;beginparbeginproducer:beginrepeat…produceranitemnextp;…wait(empty);wait(mutex);buffer(in):=nextp;in:=(in+1)modn;signal(mutex);signal(full);untilfalse;end第二章进程管理consumer:beginrepeatwait(full);wait(mutex);nextc:=buffer(out);out:=(out+1)modn;signal(mutex);signal(empty);consumertheiteminnextc;untilfalse;endparendend第二章进程管理27哲学家进餐问题1.Varchopstick:array[0,…,4]ofsemaphore;