Re: Writing to same file from two threads

2013-03-01 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > On Wed, 27 Feb 2013 13:26:18 +, Antoine Pitrou wrote: > > > For the record, binary files are thread-safe in Python 3, but text files > > are not. > > Where is this documented please? In the documentation, of course ;) http://docs.python.org/3.3/li

Re: Writing to same file from two threads

2013-02-27 Thread Steven D'Aprano
On Wed, 27 Feb 2013 13:26:18 +, Antoine Pitrou wrote: > For the record, binary files are thread-safe in Python 3, but text files > are not. Where is this documented please? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to same file from two threads

2013-02-27 Thread Jens Thoms Toerring
Antoine Pitrou wrote: > Jens Thoms Toerring toerring.de> writes: > > > > Paul Rubin nospam.invalid> wrote: > > > jt toerring.de (Jens Thoms Toerring) writes: > > > > in garbled output (i.e. having some output from A inside a > > > > line written by B or vice versae) because the "main thread" o

Re: Writing to same file from two threads

2013-02-27 Thread Antoine Pitrou
Jens Thoms Toerring toerring.de> writes: > > Paul Rubin nospam.invalid> wrote: > > jt toerring.de (Jens Thoms Toerring) writes: > > > in garbled output (i.e. having some output from A inside a > > > line written by B or vice versae) because the "main thread" or > > > Yes they do get garbled li

Re: Writing to same file from two threads

2013-02-26 Thread Jens Thoms Toerring
Paul Rubin wrote: > j...@toerring.de (Jens Thoms Toerring) writes: > > in garbled output (i.e. having some output from A inside a > > line written by B or vice versae) because the "main thread" or > Yes they do get garbled like that. Preferred Python style is put a > single thread in charge of a

Re: Writing to same file from two threads

2013-02-26 Thread Paul Rubin
j...@toerring.de (Jens Thoms Toerring) writes: > in garbled output (i.e. having some output from A inside a > line written by B or vice versae) because the "main thread" or Yes they do get garbled like that. Preferred Python style is put a single thread in charge of all the i/o to that file, and

Writing to same file from two threads

2013-02-26 Thread Jens Thoms Toerring
Hi, I noticed in someone elses program that it writes single lines to the same file from (what I call for loss of a better name) the "main thread" of the program and from a thread sub- sequentally started. This got me worried if it might result in garbled output (i.e. having some output from A