-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting the capacity of the underline pipe. Linux only #322
Comments
Please let me know how can I improve my PR, to better suite the code base. |
I don't think this should be in the code base, as it's only a linux thing. On windows you have to set this on startup. Why can't you just call Did you look at the boost.process v2? It's still marked as experimental, but only because I didn't yet use it in a big project myself. |
Hey.
I am really trying to make the library more of a plug and play. The docs don't cover the full capability of this amazing library, so users are lost. |
It sounds like a good addition, I am also using boost::process and always need to set the pipe any time I create a new process, will be good to add it to the library. |
I work for a big security vendor, and recently we tried to shift from libc interface (fork, exec, waitpid...) to Boost::Process.
However, we are missing some crucial API's related to the underline pipe.
One of the functionality we need is: Setting the pipe capacity.
If the pipe fills up, 2 things may happen (Depends if the pipe is nonblocking or blocking):
Both cases cause us to loose live data from the producer.
increasing the pipe capacity doesn't solve this issue 100%. But the possibility of this happening, diminishing by a lot.
This is crucial for us.
Running the following code for 5 seconds:
Here is some of the output:
The capacity is easily reached.
After changing the pipe capacity to the value specified at: /proc/sys/fs/pipe-max-size, I was able to 20X the pipe capacity.
New code
New output:
I have created a Pull request that will add this functionality, without the the user accessing the file descriptor or calling fcntl()
PR: #324
The text was updated successfully, but these errors were encountered: