Why close other end of pipe?

May 25, 2015 at 8:08am
Why a process should close the other end of the pipe that it doesn’t use ?
May 26, 2015 at 2:00pm
Back again, hun? Read this post (this will help with your waitpid() question too.

http://www.eecs.harvard.edu/~margo/cs161/videos/fork-exec.pdf
May 27, 2015 at 2:24pm
I helped you earlier in the week (Help! Need to design and implement a basic shell). I was talking to you. I'm not Chinese.
Last edited on May 27, 2015 at 2:26pm
May 27, 2015 at 8:27pm
Suppose the child reads the pipe but doesn't close the writing end. How will it know when to stop reading? If there is no data to read, the OS will simply block the process until a writer adds something to the pipe, and for all the OS knows, that could be the very same process that's trying to read it.
May 27, 2015 at 10:47pm
what do you mean?
May 29, 2015 at 12:16pm
Thanks dhayden...sorry for misunderstanding booth
Topic archived. No new replies allowed.