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.


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.
  • Comment on Re^7: [threads] Open a file in one thread and allow others to write to it

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.