Process exit on Windows and Linux



  • The problem here is the difference in the idea of process. Which like almost all ideas in computing, is entirely arbitrary.

    As I understand it, Unix (and therefore its successors) was designed with the idea of processes being relatively simple things, each specialized in doing one thing, streaming data to each other over pipes, processing it and returning it. Want to filter and sort a list? Just launch grep and sort and send it to them. And of course your subprocess could have subprocesses you didn't know about, just like any function can call other functions.

    So in this model, every application would end up with a big tree of subprocess, and you could really consider those subprocesses as children since it makes no sense to let them run without the parent.

    However, this is not what most people today interpret as a process. We think of a process as a mostly independent thing, like a browser or a text editor. So parent-child relations are not so meaningful.



  • @Kian said:

    Could also be intended to use the Pimpl idiom (hide implementation details behind a pointer so including the class header doesn't include implementation specific headers).

    I would say yes, but the code in question has two members. Normally you only have one PImpl member. If it were one member though, then yes you are right.



  • Fancier PIMPL implementations usually use a shared_ptr equivalent so you can copy-on-write.


Log in to reply