【发布时间】:2012-04-04 08:00:30
【问题描述】:
你好我的朋友我有这个例子我不明白解决方案: 这就是问题所在:
是3个进程P1,P2,P3,分别对信号量进行三个操作,S1,S2,S3,初始值:S1 = 1, S2 = 1,S3 = 1。知道每个进程在一个循环内执行以下序列,以指示是否有任何可能停留在interbloqueig 状态。如果是这样,除了说明指令执行的顺序外,还要通过图映射资源来证明。
**P1** **P2** **P3**
P(s1) P(s3) P(2)
P(s3) P(s2) the critical section
the critical section P(s1) V(s2)
V(s3) the critical section
V(s1) V(s1)
V(2)
V(3)
就像我有这个: 我认为这是不正确的!
【问题讨论】:
标签: c linux pthreads mutex semaphore