操作系统 经典同步问题.pptVIP

  • 50
  • 0
  • 约2.19千字
  • 约 21页
  • 2017-11-25 发布于湖北
  • 举报
操作系统 经典同步问题

Semaphore Primitives Mutual Exclusion Using Semaphores Producer producer: while (true) { /* produce item v */ b[in] = v; in++; } Consumer consumer: while (true) { while (in = out) /*do nothing */; w = b[out]; out++; /* consume item w */ } Producer/Consumer Problem Monitors Monitor is a software module:procedures,initialize serial and local data. Chief characteristics Local data variables are accessible only by the monitor Process enters monitor by invoking one of its procedures Only one process may be executing in the monitor at a time Message Passing Enforce mutual exclusion Ex

文档评论(0)

1亿VIP精品文档

相关文档