6 ms·
The classic application from appending from multiple sources while potentially modifying a file and potentially having NFS in the way is a mail spool using mbox
by pjc50 10y ago
The classic application from appending from multiple sources while potentially modifying a file and potentially having NFS in the way is a mail spool using mbox.
While there are various hard-won implementations that work doing this, it's also one of the reasons maildir was invented.
It's much more portable, comprehensible, and reliable to have a single process writing to the file and all the other producers sending records to it using sockets or named pipes. The consolidator needs to be aware of record boundaries so you don't have to worry about pipe atomicity.