I've found similar questions here on Stack but I'm not sure whether they apply to PHP.
I'd like to create child processes with pcntl_fork(). I want to write messages to a log file, from both the parent and the child processes.
If I open a file handle in the parent, is it safe to write to the same handle from the childs? Note that I will only be appending to the file.
I'm afraid of the race conditions that could happen, in particular if the two processes are executed on different cores: what would happen if two processes executing on two different cores were to write to the same file handle at the same time?