aboutsummaryrefslogtreecommitdiffstats
path: root/doc/protocol
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-28 12:57:30 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-28 12:57:30 +0200
commit110027ec9f78941fcf8cc5f36b7055e17a206af6 (patch)
tree7de5440a73953d399b4f9bc986346592efb030df /doc/protocol
parentm readme (diff)
downloadbus-110027ec9f78941fcf8cc5f36b7055e17a206af6.tar.gz
bus-110027ec9f78941fcf8cc5f36b7055e17a206af6.tar.bz2
bus-110027ec9f78941fcf8cc5f36b7055e17a206af6.tar.xz
add BUS_SEMAPHORES_ARE_SYNCHRONOUS + explain some syntax in doc/protocol
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'doc/protocol')
-rw-r--r--doc/protocol21
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/protocol b/doc/protocol
index def8f6f..a846581 100644
--- a/doc/protocol
+++ b/doc/protocol
@@ -14,10 +14,14 @@ broadcast:
with P(X):
Z(W)
Write NUL-terminate message to shared memory
- with V(N):
+ with V(N): -- (1)
Q := 0
Z(S)
+ -- (1) may be omitted if semaphores are known that
+ P(·), Z(·), V(·) cannot create a race condition
+ with a processes running Z(·).
+
listen:
with V(S):
@@ -29,6 +33,17 @@ listen:
break
with V(W):
with P(S):
- Z(S)
- Z(N)
+ Z(S)
+ Z(N)
+
+
+`V(a)` means that semaphore a is released.
+`P(a)` means that semaphore a is acquired.
+`Z(a)` means that the process waits for semaphore a to become 0.
+`with P(a)` that `P(a)` is done before the entering the scope,
+and `V(a)` is done when exiting the scope. It also means that
+these actions [P(a) and V(a)] are undone when the process exits,
+or if the call fails.
+`with V(a)` that `V(a)` is like `with P(a)` that `P(a)` and
+`V(a)` are exchanged.