On 10/07/13 01:11, Greg Turner wrote:
Alan wrote:
- redirect_alloc_fd mj_control_fd "${pipe}"
+ redirect_alloc_fd mj_write_fd "${pipe}"
+ redirect_alloc_fd mj_read_fd "${pipe}"
The one thing I'd be looking to verify is that there's no race where
where the reader must block before the writer starts producing data.

You could test that hypothesis by sleeping for a while right before
the reader starts listening.

If that were the case -- I kinda suspect it is -- then unfortunately,
I think the writer has to spin, waiting for the reader to block... not
a pretty situation, so let's hope I'm confused.


I don't understand. There is no race, the above two commands just get two different file descriptors for the read end and the write end. The FIFO is opened in non-blocking IO mode anyway, as the FIFO is still opened in read/write mode to get this behaviour. So the actual read from one fd, and the write from another fd behaves no differently to reading and writing from the same fd.

Alan.

Reply via email to