[Python-Dev] Support for async read/write (original) (raw)
exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Oct 20 03:55:20 CEST 2010
- Previous message: [Python-Dev] Support for async read/write
- Next message: [Python-Dev] Support for async read/write
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 01:37 am, glyph at twistedmatrix.com wrote:
On Oct 19, 2010, at 8:09 PM, James Y Knight wrote: There's a difference.
os.exit is useful. os.open is useful. aio* are not useful. For anything. If there's anything you think you want to use them for, you're wrong. It either won't work properly or it will worse performing than the simpler alternatives. I'd like to echo this sentiment. This is not about providing a 'safe' wrapper to hide some powerful feature of these APIs: the POSIX aio* functions are really completely useless. To quote the relevant standard <http://www.opengroup.org/onlinepubs/000095399/basedefs/aio.h.html>:
APPLICATION USAGE
None. RATIONALE None. FUTURE DIRECTIONS None. Not only is the performance usually worse than expected, the behavior of aio* functions require all kinds of subtle and mysterious coordination with signal handling, which I'm not entirely sure Python would even be able to pull off without some modifications to the signal module. (And, as Jean-Paul mentioned, if your OS kernel runs out of space in a queue somewhere, completion notifications might just never be delivered at all.)
Just to be clear, James corrected me there. I thought Jesus was talking about the mostly useless Linux AIO APIs, which have the problems I described. He was actually talking about the POSIX AIO APIs, which have a different set of problems making them a waste of time.
Jean-Paul
- Previous message: [Python-Dev] Support for async read/write
- Next message: [Python-Dev] Support for async read/write
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]