RFD: Rework/extending functionality of mdev
Laurent Bercot
ska-dietlibc at skarnet.org
Sun Mar 15 19:06:33 UTC 2015
On 15/03/2015 19:39, Harald Becker wrote:
> On most systems it is perfectly possible to have multiple readers on
> a pipe, when all readers and writers be so polite to use the same
> message size (<= PIPE_BUF). On most (but not all Unix systems) the
> kernel guaranties not only atomicity for write operations, but also
> for read operations (not in POSIX, AFAIK).
Second sentence of
http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html :
The behavior of multiple concurrent reads on the same pipe, FIFO,
or terminal device is unspecified.
What "most systems" do in practice is irrelevant. There is no guarantee
at all on what a system will do when you have multiple readers on the
same pipe; so it's a bad idea, and I don't see that there's any room for
discussion here.
If, say, Linux has documentation somewhere explaining what it does with
multiple readers on a pipe, and committing to NOT changing that behaviour
EVER, then it might be reasonable for Linux-specific software to rely on
it. I'm not aware of such a piece of documentation though.
--
Laurent
More information about the busybox
mailing list