3 ms·
Couldn't you use a named pipe to send data from each process to a single writer process?
by adenner 10y ago
Couldn't you use a named pipe to send data from each process to a single writer process?
- herge 10y agoHow would the single writer process know that one 'atom' of writing has been received from each process? The named pipe might be empty if the sending process is filling it's buffer with the second half of the message.
- kbenson 10y agoPresumably you would have some protocol to passing the messages that handles this, such as at the simplest level wrapping the the message with a preceding length and following end of record identifier, which in conjunction should work. But that's the (implicit) point of all this, now you've added a bunch of logic for an accumulating writer, a protocol to pass messages between the processes, and state so that partially received messages can be continued when you get back to that process. Now the application has a non-trivial amount of logic and code to deal with logging which might be a source of problems itself. As another commenter noted, individual files per process with an aggregation step (or specialized reader) is much simpler and easier to reason about and mirrors actual case in the article where it was eventually inserted into SQLite, which essentially enforces this read ordering as needed (if there is an ordering field).