admin管理员组

文章数量:1530021

临界区问题:
假设现有n个进程(P1, P2,…,Pn), 每个进程都如图所示, 拥有一个可以修改共享变量(变量, 文件, 数据库表等)的临界区(critical section), 要求任何一个进程在临界区执行时, 其他都不能执行.

正式定义:

  1. Mutual exclusion(互斥): When a thread is executing in its critical section, no other threads can be executing in their critical sections.
  2. Progress(前进): If no thread is executing in its critical section, and if there are some threads that wish to enter their critical sections, then one of these threads will get into the critical section.
  3. Bounded waiting(有限次等待): After a thread makes a request to enter its critical section, there is a bound on the number of times that other threads are allowed to enter their critical sections, before the request is granted.

本文标签: 临界进程ProblemCriticalsection