From c21cacfe19a8f0ec0676c21db23592e3b9ed5175 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 26 Mar 2020 17:45:16 -0400 Subject: [PATCH] Note problems with lossless msg-handling alternatives --- x5/khatus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/x5/khatus.c b/x5/khatus.c index 35509d4..5928dfb 100644 --- a/x5/khatus.c +++ b/x5/khatus.c @@ -291,6 +291,19 @@ slots_read(Config *cfg, struct timespec *ti, char *buf) * This is an acceptable trade-off because we * are a stateless reporter of a _most-recent_ * status, not a stateful accumulator. + * + * ### LOSSLESS ALTERNATIVES ### + * - Read each pipe until EOF before reading + * another. + * PROBLEM: a fast writer can trap us in the + * read loop. + * + * - Read each pipe until EOM, but close only + * at EOF. + * PROBLEM: a fast writer can fill the pipe + * faster than we can read it and we end-up + * displaying stale data. + * */ case END_OF_MESSAGE: case END_OF_FILE: -- 2.20.1