Can multiple processes write to the pipe simultaneously?

Can multiple processes write to the pipe simultaneously?


If each piece of data written to the pipe is less than PIPE_BUF
in size, then they will not be interleaved. However, the boundaries of
writes are not preserved; when you read from the pipe, the read call
will return as much data as possible, even if it originated from
multiple writes.



The value of PIPE_BUF is guaranteed (by Posix) to be at
least 512. It may or may not be defined in `<limits.h>', but
it can be queried for individual pipes using pathconf() or
fpathconf().






Home FAQ