A simple way to write to a file in different threads simultaneously.