进程同步02--临界区问题(Critical Section Problem)

临界区问题:
假设现有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.
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值