[issue13517] readdir() in os.listdir not threadsafe on OSX 10.6.8

Charles-François Natali report at bugs.python.org
Thu Dec 1 23:41:54 CET 2011


Charles-François Natali <neologix at free.fr> added the comment:

And here's a post by Ulrich Drepper:
http://udrepper.livejournal.com/18555.html

"""
readdir_r is only needed if multiple threads are using the same directory stream. I have yet to see a program where this really is the case. In this toy example the stream (variable dir) is definitely not shared between different threads. Therefore the use of readdir is just fine. Should this matter? Yes, it should, since readdir_r has to copy the data in into the buffer provided by the user while readdir has the possibility to avoid that.
"""

So I'm even more confident that we should keep the current code.
At least, before going any further (and complicating the code), I'd like to know whether this can be reproduced with a small C snippet.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13517>
_______________________________________


More information about the Python-bugs-list mailing list