[Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()?
Ronald Oussoren
ronaldoussoren at mac.com
Mon Apr 17 20:30:04 CEST 2006
On 17-apr-2006, at 18:19, Martin v. Löwis wrote:
> Currently, the readdir() call releases the GIL. I believe
> this is not thread-safe, because readdir() does not need
> to be re-entrant; we should use readdir_r where available
> to get a thread-safe version.
>
> Comments?
AFAIK readdir is only unsafe when multiple threads use the same DIR*
at the same time. The spec[1] seems to agree with me.
It seems to me that this means the implementation of listdir in
posixmodule.c doesn't need to be changed.
Ronald
[1] : http://www.opengroup.org/onlinepubs/009695399/functions/
readdir.html
>
> Regards,
> Martin
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/
> ronaldoussoren%40mac.com
More information about the Python-Dev
mailing list