hi my question is the fallowing
I have many processes all writing to the same pipe how can I synchronize them so I don't have multiple processes writing to the pipe at the same time?
Thanks in advance.
Printable View
hi my question is the fallowing
I have many processes all writing to the same pipe how can I synchronize them so I don't have multiple processes writing to the pipe at the same time?
Thanks in advance.
You can't.
IIRC, each write() is atomic. So if you prepare what you want to write in a buffer, then use a single write() call to write it, then that data will be read at the other end of the pipe as a contiguous block (that is, not mixed up with anyone elses write calls).
sweeeet I did not know that, thats great. thanks man. i was still with thread mindset :)