I\'m writing an app that appends lines to the same file from multiple threads.
I have a problem in which some lines are appended without a new line.
Any solu
And maybe some more newlines where they shouldn't be?
You should have in mind the fact that a shared resource should not be accessed by more than one thread at a time or otherwise unpredictable consequences might happen (it's called using 'atomic operations' while using threads).
Take a look at this page for a little intuition: Thread Synchronization Mechanisms in Python