Skip to content
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

I did a refactoring of procxx. It's better to create PR or publish it as a separate project? #20

Open
eao197 opened this issue Feb 28, 2020 · 1 comment

Comments

@eao197
Copy link
Contributor

eao197 commented Feb 28, 2020

We found procxx project several years ago and used it from time to time. In the last usage, I found two important issues:

  • usage of procxx leads to the termination of the parent process if a child process exits early and closes its input stream. In that case a call to pipe_t::write in the parent throws, then the flush() method is called from a destructor and that flush() throws another time. But because the second throw is performed during stack unwinding that throw leads to std::terminate;
  • inability to do some cleanup and preparation actions before the call to execvp() in a child process.

To resolve those issues I've made a refactoring of procxx implementation. Now there are methods that accept special nothrow value and do not throw on error. Instances of std::error_code are returned instead (or std::pair<std::error_code,std::size_t>). Those non-throwing methods are used for cleanup procedures (in destructors, for example).

There is also a variant of process::exec() method that accepts a callback. This callback is called in child/parent processes just after the return from fork().

The current version of my updated procxx fork can be found here (the revisited branch).

I can make a PR, but I think it has a sense only if that PR will be accepted. But because of procxx looks like a frozen project, I'm afraid it won't be accepted.

So I can publish my refactored version under a different name. Like procxxrv (means procxx-revisited) or procxx-ng (means procxx-new-generation). Or something else if you don't want to see usage of procxx prefix in the name of a derived project.

@eao197
Copy link
Contributor Author

eao197 commented Mar 6, 2020

If someone interested in this topic: here is my attempt to reincarnate procxx library under the name procyy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant