[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

2013-12-03 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +gvanrossum, neologix, pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19827
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

2013-12-03 Thread Guido van Rossum

Guido van Rossum added the comment:

LGTM.  I know I've written similar code in Python. :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19827
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

2013-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5f0d1aad7322 by Victor Stinner in branch 'default':
Close #19827: On UNIX, setblocking() and settimeout() methods of socket.socket
http://hg.python.org/cpython/rev/5f0d1aad7322

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19827
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

2013-11-28 Thread STINNER Victor

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 rep...@bugs.python.org
http://bugs.python.org/issue19827
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com