vault backup: 2025-03-12 11:49:27
This commit is contained in:
parent
c9d53c7954
commit
513c546ab8
1 changed files with 5 additions and 3 deletions
|
@ -181,7 +181,7 @@ end_write() :=
|
||||||
GLOB_MUTEX.up()
|
GLOB_MUTEX.up()
|
||||||
return
|
return
|
||||||
```
|
```
|
||||||
|
If readers keeps arriving, they surpass writers. But when a writer terminates a
|
||||||
##### Strong priority to Readers
|
##### Strong priority to Readers
|
||||||
When a writer terminates, it activates the first reader, if there is any, or the first writer, otherwise.
|
When a writer terminates, it activates the first reader, if there is any, or the first writer, otherwise.
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ end_write() :=
|
||||||
W_MUTEX.up()
|
W_MUTEX.up()
|
||||||
return
|
return
|
||||||
```
|
```
|
||||||
|
This is prioritizing readers as `GLOB_MUTEX.up()` is called before `W_MUTEX.up()`, this is stronger that what it is done before.
|
||||||
##### Weak priority to Writers
|
##### Weak priority to Writers
|
||||||
```
|
```
|
||||||
GLOB_MUTEX, PRIO_MUTEX (to prioritize the writers), R_MUTEX and W_MUTEX semaphores init. at 1
|
GLOB_MUTEX, PRIO_MUTEX (to prioritize the writers), R_MUTEX and W_MUTEX semaphores init. at 1
|
||||||
|
@ -242,3 +242,5 @@ def end_write() :=
|
||||||
PRIO_MUTEX.up()
|
PRIO_MUTEX.up()
|
||||||
W_MUTEX.up()
|
W_MUTEX.up()
|
||||||
return
|
return
|
||||||
|
```
|
||||||
|
This is prioritizing writers as if there are writers waiting, they will be waiting at `GLOB_MUTEX.down()`. This semaphore is upped before `PRIO_MUTEX` which is the one that blocks readers.
|
Loading…
Reference in a new issue