On May 8, 1:29 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 7 May 2007 00:13:46 -0700, est <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > > > I'll try Queue.Queue, thank you. I didn't expect that multithread > > write a file is so troublesome > > Multiple writers to a file, threaded or not (ie, multiple processes, > hosts on network, etc.), is always a pain unless one can ensure that all > writers use a common locking mode to prevent overlapping calls. If all > the writers are internal to one program, one can implement internal > locks -- if external one needs OS support for multi-process locking (VMS > common event flag clusters, for example). Easier to dedicate one > (internal) writer and use the naturally locked Queue to control access. > -- > Wulfraed Dennis Lee Bieber KD6MOG > [EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [EMAIL PROTECTED]) > HTTP://www.bestiaria.com/
I guess I will write multiple files, one thread one file, and after all threads terminates, I combine the files. That's a cheaper solution, I think. -- http://mail.python.org/mailman/listinfo/python-list