<div dir="ltr"><br><div class="gmail_quote">On Wed, Feb 17, 2010 at 1:01 AM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On 2/16/2010 4:37 PM, Doron Tal wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is the GIL released during import statement execution when accessing the<br>
file?<br>
If not, is it a bug?<br>
If it is not a bug, or it is here to stay for any other reason, I think<br>
it should be mentioned in the documentation.<br>
</blockquote>
<br></div></div>
The CPython GIL is a CPython implementation artifact and should not be mentioned in the language docs (and is not, as far as I know). Were you thinking of something else? And why this specific feature of its behavior, whatever it is.<br>
<br>
tjr<br><font color="#888888">
<br>
<br>
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>I'm sorry, I should have explained my case better.<br>Quoting the documentation (<a href="http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock">http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock</a>):<br>
<br> "The lock is also
released and reacquired around potentially blocking I/O operations like reading
or writing a file, so that other threads can run while the thread that requests
the I/O is waiting for the I/O operation to complete."<br><br><br>Since on some cases the IO may be _very_ slow, any IO command which does not release the GIL can potentially stall the process. There are two problems (or more...), the first, it may stall the process for unacceptable duration. The second problem is that it is not an easy task to track down the root cause of this stall.<br>
<br>In the specific case I'm dealing with, the problematic command is execfile (at the time of my initial writing I did not know that).<br><br>--doron<br><br></div>