Message99996
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. |
|
Date |
User |
Action |
Args |
2010-02-24 02:24:56 | Alexander.Belopolsky | set | recipients:
+ Alexander.Belopolsky, loewis, theller, pitrou, marcin.bachry, brian.curtin, nikratio |
2010-02-24 02:24:56 | Alexander.Belopolsky | set | messageid: <1266978296.19.0.88415967057.issue7736@psf.upfronthosting.co.za> |
2010-02-24 02:24:54 | Alexander.Belopolsky | link | issue7736 messages |
2010-02-24 02:24:54 | Alexander.Belopolsky | create | |
|