Charles-François Natali added the comment:

>> memoryview is also great to avoid copies when sending/receiving to a socket.
>
> That's interesting. How exactly? Would producer_fifo have to change from a 
> deque() to a memoryview() object? In that case we might have to take backward 
> compatibility into account (producer_fifo already changed in 2.6 and if I'm 
> not mistaken that might have caused some problems).
> Maybe it makes sense to file a separate issue to address asynchat 
> enhancements.

Probably.
For an example of how it might be used, you can have a look here:
http://stackoverflow.com/questions/6736771/buffers-and-memoryview-objects-explained-for-the-non-c-programmer
and here:
http://eli.thegreenplace.net/2011/11/28/less-copies-in-python-with-the-buffer-protocol-and-memoryviews/

Also, IIRC, Antoine used memoryviews when rewriting parts of
multiprocessing in pure Python.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16787>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to