Background

Race Condition

<aside> 📖 多個 process 操作 shared data concurrently,結果會取決於最後完成的人。(這是描述一個問題點,所以是因為有 race condition,要用同步化解決)

</aside>

Critical Section

Critical Section Requirements

  1. Mutual Exclusion: if process P is executing in its CS, no other processes can be executing in their CS
  2. Progress: 有 process 想要進去空的 critical section,就應該要讓他馬上進去。(有效性)
  3. Bounded Waiting: 不能讓等的人一直等,要 bound 他的 waiting time。(公平性)

Review Slide