vault backup: 2025-03-17 09:49:23
This commit is contained in:
parent
4f9620a1f5
commit
cd407da403
2 changed files with 17 additions and 3 deletions
|
@ -55,4 +55,18 @@ C.signal() :=
|
|||
PRIO.down()
|
||||
NPR--
|
||||
```
|
||||
p.s. The wait **always** suspends, even if there is only a process.
|
||||
p.s. The wait **always** suspends, even if there is only a process.
|
||||
|
||||
#### Readers/Writers problem, strong priority to Readers
|
||||
```
|
||||
monitor RW_READERS :=
|
||||
AR, WR, AW, WW init at 0
|
||||
condition CR, CW
|
||||
|
||||
operation begin_read() :=
|
||||
WR++
|
||||
if AW != 0 then
|
||||
CR.wait()
|
||||
CR.signal()
|
||||
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue