[Python-Dev] Support for async read/write

Jesus Cea jcea at jcea.es
Fri Feb 4 16:30:01 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20/10/10 00:58, Antoine Pitrou wrote:
> It would be nice to know about the use case Jesus has in mind.

I am thinking about the cases where a request come, you do some disk
read in behalf of it and you reply.

If the read is "slow" (if not cached, you have to deal with a physical
harddisk), you stop the main-loop for a while, unless you use threads.

If, instead, I can schedule a read and keep processing other requests
(possibly queueing new reads), be notified when the read is done and
complete the reply, I think this is more simple and performing (and far
less memory hungry) that using threads.

I just opened a issue, assigned to me. I plan to do the implementation
myself, at least for Solaris and possibly (recent) Linux:
<http://bugs.python.o rg/issue11117>.

Some people say AIO OS implementations are flaky. Well, you must deal
with it, like you deal with other flaky OS corners, like exhausting
memory or whatever.

I would suppose that if Python exposes AIO and in some OS support is
underpar, the exposing would incentivate a better support for OS. Like
happened to threads and linux years ago.

- -- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQCVAwUBTUwbeZlgi5GaxT1NAQK4uwP+J3PwGY1dvBi+OyBo9M9UWsma0khgzdUS
6ewHhCrCK+U5HK0e/g9cLbesBSsYvVfNjPe+fb9cQuwMBK0lpF3kOzfsEf82RIxR
NlsqOba31CE1tW9uS4wja0TddFDob3IImqgwSB7NptBOZTNVjDvB6k0V7KHqvPWX
9g01GqaQ9uQ=
=hx6M
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list