in reply to Threads and output files (locking)

My suggestion would be to start an extra process that opened four sockets or named pipes and have the other processes write to those.

ps. You might have received more responses had you not mentioned threads in your title when you are not using threading.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.