JeffGarland / liaw2019-process

Repository for initial drafting of boost.process standards paper
MIT License
5 stars 4 forks source link

Cologne SG1: process destructor should not terminate program #39

Closed JeffGarland closed 4 years ago

JeffGarland commented 4 years ago
    // The destructor terminates 
    ~process();

Feedback was clear on this point. std::thread was done wrong and that's part of the reason we have jthread now.

The logic of ~jthread amounts to checking if the thread is joinable and then calling request_stop() followed by join() on the thread.

So processes don't have join -- will just be wait, but could call wait.

Another option that was suggested was to call process::terminate on the child

So will make this an open issue for further committee discussion. As I see it the options are

  1. call process::terminate on child
  2. call wait() in the destructor
  3. add some sort of request_stop interface to process to mirror jthread api -- this could then do either 1 or 2
  4. a constructor option to pick from pre-defined behavior