[Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446) (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Fri Jul 26 14:25:25 CEST 2013
- Previous message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Next message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le Fri, 26 Jul 2013 14:08:35 +0200, Victor Stinner <victor.stinner at gmail.com> a écrit :
After having written 2 PEP on the topic, I slowly agree that make all file descriptors non-inheritable is the best compromise. It solves most, or all, issues.
Even stdin/stdout/stderr? I think inheriting them is the sane default.
The main drawback is the additionnal syscalls: on some platforms, 2 additional syscalls are need to make a file descriptor non-inheritable for each creation of file descriptor. According to my benchmark on the implementation of the PEP 433: the overhead of making a file descriptor non-inheritable is between 1% and 3% (7.8 µs => 7.9 or 8.0 µs) on Linux 3.6.
1% and 3% of what? You're telling us there's a 0.1µs overhead. It's positively tiny.
Regards
Antoine.
- Previous message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Next message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]