Author javen72
Recipients amaury.forgeotdarc, eckhardt, ggenellina, javen72
Date 2009-01-15.04:36:27
SpamBayes Score 0.00282278
Marked as misclassified No
Message-id <1231994189.62.0.687251030746.issue4944@psf.upfronthosting.co.za>
In-reply-to
Content
I agree multithread programming is kind of difficult and tricky. But I
don't think there's a race condition in _MultiThreadBuildPlatform
method, because I do have only one producer. And the consumer consumes
the product only when it's done (i.e. the file is created and closed).
The only race condition, I think, it's in the Python or Windows file
system, in which the file created might not be seen by other process due
to the file buffer mechanism. I think the flush() method of file object
and os.fsync() are to remove the race condition. But it seems that they
are not working as they're supposed to be.

What I know is that os.fsync() calls the _commit() which calls
FlushFileBuffers(). Why no problem if I call the FlushFileBuffers()
directly? That's why I think the most possible race condition is in
Python file buffer operation which is out of the control of my Python code.

I'm sorry that I didn't realize there's 150M code to checkout. Thanks
for your patience. Actually they are not code of my application itself.
They are the code used to test my application because my application is
a build system which needs source code to build. The real code of my
application is in the, for my example, directory of
C:\test\tools\Source\Python with just about 3M source files :-) And I
think I have narrowed down the issue in the file creation in
SaveFileOnChange function in C:\test\tools\Source\Python\Common\Misc.py. 

I know it's very hard to reproduce issue in multi-thread context. And I
cannot say absolutely there's no bug in my code. It's OK for you to
close this tracker. But it would be better to let it open for a few days
so that I can do more investigation then. Anyway, thanks for the trying
again.
History
Date User Action Args
2009-01-15 04:36:29javen72setrecipients: + javen72, amaury.forgeotdarc, ggenellina, eckhardt
2009-01-15 04:36:29javen72setmessageid: <1231994189.62.0.687251030746.issue4944@psf.upfronthosting.co.za>
2009-01-15 04:36:28javen72linkissue4944 messages
2009-01-15 04:36:27javen72create