[Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()? (original) (raw)
Ronald Oussoren ronaldoussoren at mac.com
Mon Apr 17 20:30:04 CEST 2006
- Previous message: [Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()?
- Next message: [Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 readdirr 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
- Previous message: [Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()?
- Next message: [Python-Dev] Py_BEGIN_ALLOW_THREADS around readdir()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]