diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-04-16 19:45:08 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-04-16 19:45:08 +0200 |
commit | 9c7c2b9151077615e7cfb41082d32ebb2e9bcc50 (patch) | |
tree | 91430f9e07739a1a43bc98e453034d88346f7784 | |
parent | makefile: static lib (diff) | |
download | bus-9c7c2b9151077615e7cfb41082d32ebb2e9bcc50.tar.gz bus-9c7c2b9151077615e7cfb41082d32ebb2e9bcc50.tar.bz2 bus-9c7c2b9151077615e7cfb41082d32ebb2e9bcc50.tar.xz |
doc: protocol
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | doc/protocol | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/protocol b/doc/protocol new file mode 100644 index 0000000..bdff6ac --- /dev/null +++ b/doc/protocol @@ -0,0 +1,33 @@ +init: + Select a filename. + + Create XSI semaphore array {S = 0, W = 0, X = 1 and Q = 0} + with random key. Store the semaphore array's key in + decimal form on the first line in the selected file. + + Create XSI shared memory, with an allocation of 2048 bytes, + with a random key. Store the shared memory's key in + decimal form on the second line in the selected file. + + +broadcast: + with P(X): + Z(W) + Write NUL-terminate message to shared memory + Q := 0 + Z(S) + + +listen: + V(S) with undo on exit + forever: + V(Q) + Z(Q) + Read NUL-terminated message from shared memory + if breaking: + P(S) with undo on exit + break + with V(W): + with P(S): + Z(S) + |