操作系统课件os02进程同步资料教程.pptVIP

  • 0
  • 0
  • 约2.5千字
  • 约 58页
  • 2018-11-29 发布于天津
  • 举报
操作系统课件os02进程同步资料教程.ppt

操作系统 Operating Systems;生产者-消费者问题;生产者-消费者问题;生产者-消费者问题;生产者-消费者问题;临界区;临界区;同步机制应遵循的规则;;2 记录型信号量;申请一个单位资源: procedure wait(S)  var S:semaphore; begin S.value:=S.value-1; if S.value0 then block(S.L); end ;一般信号量;上述的进程互斥问题,是针对各进程之间只共享一个临界资源而言的。 ;3 AND同步机制的基本思想;Swait(S1,S2,…,Sn)   if S1=1 and … and Sn=1 then    for i:=1 to n do     Si:=Si-1;    endfor   else    当发现第一个 Si1就把该进程放入等待队列, 并将其指令计数器置于Swait操作的开始位置   endif; Ssignal(S1,S2,…,Sn) for i:=1 to n do   Si:=Si+1; Remove all the process waiting in the queue associated with Si into the ready queue. endfor; ;2.3.3 信号量的应用

文档评论(0)

1亿VIP精品文档

相关文档