in reply to Re: Sharing STDIN after fork
in thread Sharing STDIN after fork

Thanks Corion

Does it make any difference which process is used for which operation or are they interchangeable?

Replies are listed 'Best First'.
Re^3: Sharing STDIN after fork
by Corion (Patriarch) on Feb 14, 2022 at 06:41 UTC

    No, both processes are almost identical - the only difference when they start out is the result of the call to [func://fork].

    Usually, the web server will wait for the original program, not the forked copy, to finish before considering the HTTP call complete, so you might want to put long-running stuff into the child. The child process is the one with a zero from fork().