[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

STINNER Victor report at bugs.python.org
Mon Jun 2 14:36:02 CEST 2014


STINNER Victor added the comment:

I have no opinon on close() vs setting CLOEXEC flag, but you should use _Py_set_inheritable(fd, 0, NULL). _Py_set_inheritable() is able to set the CLOEXEC flag in a single syscall, instead of 2 syscalls. _close_fds_by_brute_force() is already very slow when the maximum file descriptor is large:
http://legacy.python.org/dev/peps/pep-0446/#closing-all-open-file-descriptors

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list