首页 归档 关于 learn love 工具

Critical section: Definition of the problem

  • Safety
    • Mutual exclusion: At most one thread can be in CS at a time
  • Liveness
    • Progress: If no thread is currently in CS and threads are trying to access, one should eventually be able to enter the CS.
    • Bounded waiting: Once a thread T starts trying to enter the CS, there is a bound on the number of times other threads get in.

About liveness requirements

Liveness requirements are mandatory for a solution to be useful

Progress vs. Bounded waiting

  • Progress: If no thread can enter CS, we don’t have progress.
  • Bounded waiting: If thread A is waiting to enter CS while B repeatedly leaves and re-enters C.S. ad infinitum, we don’t have bounded waiting