Quote:
Originally Posted by gal_netanel
I read that writing to pipe buffer less that PIPE_BUFF made in atomic opreation. Does the same apply to reading from pipe ?
|
Yes. Though I am not 100% sure, but it would amaze me if reading from a pipe (less than PIP_BUFF) is not atomical.
Quote:
Originally Posted by gal_netanel
I want to use pipe with one writer and multiple reader and want to make sure that pipes does the work without that i need to use semaphore betweent the readers.
|
Pipes are one-way and one-to-one only. So to have one writer and multiple readers you would have to create (and write to) as much pipes as there are reader-processes.
I'd recommend using a UNIX-domain socket (also called "filesystem socket" or "local socket") instead.
You can read about pipes and UNIX-domain socket in
this PDF.