《OPERATING SYSTEMS教学课件》ch2b.pptVIP

  • 8
  • 0
  • 约1.13万字
  • 约 62页
  • 2016-09-20 发布于浙江
  • 举报
* The producer-consumer problem using semaphores exchange * In conclusion, we use semaphores in two different ways: mutual exclusion (mutex); process synchronization (full, empty). Is it easy to use semaphores? * Mutex: Binary Semaphore Simplified version of semaphore Mutex is used for mutual exclusion problem A variable with only 2 states Lock Unlock * Mutual Exclusion Problem using Mutex semaphore mutex = 1; /* set mutex.count = 1 */ DOWN(mutex); - critical section - UP(mutex); For two parallel processes, the value of mutex is 1, 0, -1 For N parallel processes, the valu

文档评论(0)

1亿VIP精品文档

相关文档