Multiple Threads - I/O in Same File

Nikunj.Badjatya at emc.com Nikunj.Badjatya at emc.com
Mon Nov 21 08:15:28 EST 2011


Hi All,


Just a question in general.  Is it possible that we have opened one file in r+ mode ( file1.txt ).

We have 2 threads,

*         Thread1 will continuously 'only read' the file in a loop.

*         Thread2 will only update the data in the file ( say a number < 100 ).

Now thread2 has called other script ( written in say Perl/Powershell using subprocess.call() ) and those scripts are inturn updating ( only writing ) into that file by their own file i/o mechanism.



Is it possible by any chance? One file being shared between different processes one is only updating and other is only reading ..? Will this work in practical and what can be the complications ?


Thanks
Nikunj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111121/b265c06b/attachment.html>


More information about the Python-list mailing list