vault backup: 2025-03-12 11:49:27

This commit is contained in:
Marco Realacci 2025-03-12 11:49:27 +01:00
parent c9d53c7954
commit 513c546ab8

View file

@ -181,7 +181,7 @@ end_write() :=
GLOB_MUTEX.up()
return
```
If readers keeps arriving, they surpass writers. But when a writer terminates a
##### Strong priority to Readers
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()
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
```
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()
W_MUTEX.up()
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.