<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 4, 2013 at 6:09 PM, Shachar Shemesh <span dir="ltr"><<a href="mailto:shachar@shemesh.biz" target="_blank">shachar@shemesh.biz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="direction:ltr" bgcolor="#FFFFFF" text="#000000"><div class="im">
<div>On 04/06/13 15:28, Erez D wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>thanks,<br>
<br>
so i guess if i use unidirectional connection, and the
reader does not expect to get an EOF()<br>
</div>
thank i'm safe.<br>
<br>
</div>
</div>
</div>
</blockquote></div>
Why are you so keen on doing it wrong?<br>
<br>
No, you are not safe. If the child process dies because of a
segmentation fault (or whatever), the parent will notice this
through the EOF received (I am assuming here, since you couldn't be
bothered with closing a file descriptor, that you did not install a
SIGCHLD handler to monitor for this possibility). This means that
should one process die unexpectedly, the other will hang forever.<br></div></blockquote><div>it's not a matter of being bothered. closing a file has it's implications<br><br></div><div>1. close the file for one thread closes for all<br>
</div><div>2. what if i want later children using the same pipe, as in all childs write to same pipe read by parent...<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="direction:ltr" bgcolor="#FFFFFF" text="#000000">
<br>
Best practices are there for a reason, despite what others here
might have you think.<span class="HOEnZb"><font color="#888888"><br>
<br>
Shachar<br>
</font></span></div>
</blockquote></div><br></div></div>