操作系统Chapter05_OSConcurrency培训资料.pptVIP

  • 11
  • 0
  • 约8.69千字
  • 约 64页
  • 2018-05-22 发布于天津
  • 举报
操作系统Chapter05_OSConcurrency培训资料.ppt

* 信号量解决同步问题 分析进程间的制约关系,确定信号量种类。在保持进程间有正确同步关系的情况下,哪个进程先执行,彼此通过什么资源(信号量)进行协调,从而明确要设置哪些信号量。 信号量的初值与相应资源的数量有关。 同一信号量的wait,signal操作要“成对”出现。但是分别出现在不同的进程代码中。比如semWait(empty)在计算进程中,而semSignal(empty)在打印进程中。如果计算进程因为 semWait(empty)而阻塞,则以后将由打印进程取走数据后执行semSignal(empty)时把它唤醒 * 5.3.2 Producer/Consumer Problem One or more producers are generating data and placing these in a buffer One or more consumers are taking items out of the buffer one at time Only one producer or consumer may access the buffer at any one time * Producer/Consumer Problem * 5.3.2 Producer/Consumer Problem Semaphore

文档评论(0)

1亿VIP精品文档

相关文档