Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment:

Another "+1" on the patch if it is needed.  Posix module consistently releases 
the GIL while making system calls and this is a good idea independent of this 
particular issue.

Looking at the patch made me wonder whether existing

                Py_BEGIN_ALLOW_THREADS
                ep = readdir(dirp);
                Py_END_ALLOW_THREADS

is safe.  Apparently it is safe as was explained in

http://mail.python.org/pipermail/python-dev/2006-April/063808.html

because "The pointer returned by readdir() points to data which may be 
overwritten by another call to readdir() on the same directory stream. This 
data is not overwritten by another call to readdir() on a different directory 
stream."

It may be appropriate to add a comment near the readdir() explaining why it is 
safe in this context.  Clearly I am not the only one who found this non-obvious.

----------
nosy: +Alexander.Belopolsky

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7736>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to