[New-bugs-announce] [issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

STINNER Victor report at bugs.python.org
Thu Nov 28 22:10:09 CET 2013


New submission from STINNER Victor:

Attached patch avoids a syscall on socket.setblocking() and socket.settimeout() when possible: use ioctl(FIONBIO) when available (not only on VMS), or use fcntl() but only call fcntl() twice if the flags changed.

The fcntl() optimization was suggested by Peter Portante some months ago:
https://mail.python.org/pipermail/python-dev/2013-January/123661.html

See also the rejected issue #19813: "Add a new optional timeout parameter to socket.socket() constructor".

----------
components: Library (Lib)
files: socket.patch
keywords: patch
messages: 204698
nosy: haypo
priority: normal
severity: normal
status: open
title: Optimize socket.settimeout() and socket.setblocking(): avoid syscall
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file32882/socket.patch

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


More information about the New-bugs-announce mailing list