Not overwriting the existing text is the least of your problems. Opening the file with the append flag specified solves the issue of overwriting. That makes sure the new data is added to the end of the file. In most cases it is a boolean added to the end of the write statement.
Concurrency is by far the bigger issue. IO is slow and you could have a lot of threads all waiting for the threads before them to open, write and close the file. At least, if that is all each thread does, no other operations, you should be spared from deadlocks.
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster
ddanbe commented: Well explained! +15
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster
hericles 289 Master Poster Featured Poster