vault backup: 2025-04-02 23:35:03
This commit is contained in:
parent
d936a07908
commit
7fe9332a40
2 changed files with 9 additions and 5 deletions
7
.obsidian/workspace.json
vendored
7
.obsidian/workspace.json
vendored
|
@ -35,8 +35,7 @@
|
||||||
"title": "4 - Semaphores"
|
"title": "4 - Semaphores"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"currentTab": 1
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
|
@ -205,10 +204,10 @@
|
||||||
"companion:Toggle completion": false
|
"companion:Toggle completion": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "e453bba00fdc57d6",
|
"active": "7c5b0ca6f7687800",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Concurrent Systems/test/Untitled.md",
|
|
||||||
"Concurrent Systems/notes/4 - Semaphores.md",
|
"Concurrent Systems/notes/4 - Semaphores.md",
|
||||||
|
"Concurrent Systems/test/Untitled.md",
|
||||||
"Concurrent Systems/notes/4b - Monitors.md",
|
"Concurrent Systems/notes/4b - Monitors.md",
|
||||||
"Concurrent Systems/notes/4c - Dining Philosophers.md",
|
"Concurrent Systems/notes/4c - Dining Philosophers.md",
|
||||||
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
|
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
|
||||||
|
|
|
@ -6,7 +6,9 @@ begin_read() :=
|
||||||
PR_MUTEX.down()
|
PR_MUTEX.down()
|
||||||
R_MUTEX.down()
|
R_MUTEX.down()
|
||||||
R++ # currently active readers
|
R++ # currently active readers
|
||||||
if R = 1 then GLOB_MUTEX.down()
|
if R = 1 then
|
||||||
|
W_MUTEX.down()
|
||||||
|
GLOB_MUTEX.down()
|
||||||
R_MUTEX.up()
|
R_MUTEX.up()
|
||||||
PR_MUTEX.up()
|
PR_MUTEX.up()
|
||||||
return
|
return
|
||||||
|
@ -19,11 +21,14 @@ end_read() :=
|
||||||
return
|
return
|
||||||
|
|
||||||
begin_write() :=
|
begin_write() :=
|
||||||
|
W_MUTEX.down()
|
||||||
|
W_MUTEX.up()
|
||||||
PR_MUTEX.down()
|
PR_MUTEX.down()
|
||||||
GLOB_MUTEX.down()
|
GLOB_MUTEX.down()
|
||||||
return
|
return
|
||||||
|
|
||||||
end_write() :=
|
end_write() :=
|
||||||
|
PR_MUTEX.up()
|
||||||
GLOB_MUTEX.up()
|
GLOB_MUTEX.up()
|
||||||
return
|
return
|
||||||
```
|
```
|
Loading…
Add table
Add a link
Reference in a new issue