For my systems programming class, I’m trying to communicate between a parent and child process using a pipe. I have a large amount of text (>64kB) that I want to send to a child process using a pipe. The child process will periodically read the text.
While writing, how do I check if the pipe is full? Also, how do I repeatedly check if the buffer has been emptied (by being read by the child process) and write the next chunk to the buffer?
I am aware that I could write the entire string out to a file, but I was just curious if there was a way to achieve this using a pipe.
For my systems programming class, I’m trying to communicate between a parent and child
Share
Pipes are blocking (unless you set it to be non-blocking). That solves your both issues.