Use agents to write to same file from multiple threads.