When the following code runs, I understand the parent and child both will run in parallel immediately after fork() is called.
#include
Apparently whatever scheduler you're running decides, and it can vary.
I can say from experience that if you assume that one of the two processes always runs first, you will introduce some very subtle race conditions. Either synchronize on something, like a special message on the pipe, or don't assume that either one runs first.