Add IPC ideas
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 28 Jun 2019 21:12:02 +0000 (17:12 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 28 Jun 2019 21:17:23 +0000 (17:17 -0400)
x5/IDEAS.md [new file with mode: 0644]

diff --git a/x5/IDEAS.md b/x5/IDEAS.md
new file mode 100644 (file)
index 0000000..2c54432
--- /dev/null
@@ -0,0 +1,41 @@
+IPC
+---
+
+### 1 file per sensor
+A sensor writes to a file, bar reads it.
+
+#### problems
+- Race condition: a sensor's message needs multiple `write` calls to complete
+  and bar reads in between those calls.
+
+This might not be so bad in practice, since we expect sensor messages to be
+small and this to complete in a single `write` call.
+
+
+### 1 pipe per sensor
+A sensor produces a message to a named pipe, bar consumes it.
+
+#### problems
+- Cannot accommodate multiple readers (besides bar, I want other tools to be
+  able to read sensor data, like the `today` script (akin to `motd`));
+- Writer blocked when no consumers, though this is irrelevant since only 1
+  consumer is possible :)
+
+
+### N pipes per sensor
+A sensor monitors a `subscribers` directory for named pipes and produces
+messages for all subscribers.
+
+#### problems
+- Reader blocked (which is fine for bar, but not for today/motd)
+
+
+### 1 file + lock per sensor
+
+#### problems
+- Lock contentions
+
+
+### 1 pipe + 1 file per sensor
+A sensor writes message to file, then to pipe, bar reads pipe, others can read
+file.
This page took 0.031325 seconds and 4 git commands to generate.