Gabriel Genellina <gagsl-...@yahoo.com.ar> added the comment: > I'm quite certain that the makefile is generated before > the "make" > program is launched in separated process. Follow is the > original code > where the makefile is created (line 14) and a task is put > in queue (line > 19). It's executed in the main thread (no parallel > execution here). > There's no way that the process is launched before the > makefile generation.
It isn't obvious that this is the case, at least to me, due to those "if" and "continue" in the code. Try instrumenting it a bit and see what happens; a few "print" around lines 14 and 19 should suffice. Also, try to come with a *short* example that shows the problem. Remove all irrelevant details: if you write a "constant" makefile and still fails, omit all dependences for makefile generation; if you invoke a simple .exe (like the one I posted) and it still fails, replace the call to nmake.exe. And so on, until you can't remove anything. It may happen that you find yourself the problem doing this. Another strategy is to start with a simple example that works (like the one I posted) and adding more and more things until it doesn't work anymore. With the code as it is now, it's difficult to say whether this is a Python bug or not; there are tons of other factors involved. > I think the Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS > should not > be used for fsync in the Python core code (in > posixmodule.c, right?). > Because fsync is mostly used to solve file operation issue > in parallel > execution context, it should not give out CPU time to other > threads or > processes when it's running. Why not? All I/O operations release the GIL, and that's a good thing. In this case, if (as you assert) the other thread that accesses the file hasn't started yet, it doesn't matter if the GIL is released or not. Yahoo! Cocina Recetas prácticas y comida saludable http://ar.mujer.yahoo.com/cocina/ _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4944> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com