On 15.03.2015 20:06, Laurent Bercot wrote:
The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified.
That is, you can't predict, which process will get the data, but each single read operation on a pipe (private or named), is done atomic. Either it is done complete and read the requested number of bytes, or it is not done at all. It won't read half of the data, then let some data pass to a different process, then continue with the read in the first process (or let that one do short read, when there is enough data).
I don't want to introduce this or use it, but please stop and think about: When each writer and each reader agree at the size of messages written / read from the pipe, you can have multiple writers *and* multiple readers on the same pipe. Due to atomicity of the write and read operations.
... and I know, it's not in POSIX / OpenGroup ... it's just working practice ... try it and you will see, it works.
... for curiosity :) (And don't fear, I won't do this) _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox