in reply to Re^6: [threads] Open a file in one thread and allow others to write to it
in thread [threads] Open a file in one thread and allow others to write to it
Why are you using a lock variable,
Because in the past I have (frequently) seen the situation where separate threads writing to the same file concurrently through buffered IO, would flush buffer-fulls, not lines, and so result in fragmentary interleaving.
And in the absence of anyone with demonstrably authoratative knowledge prepared to answer such questions, I go by the empirical eveidence of what actually happens when I do things.
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |