Python and the need for speed

Marko Rauhamaa marko at
Thu Apr 13 04:57:33 EDT 2017

Paul Rubin < at nospam.invalid>:

> Marko Rauhamaa <marko at> writes:
>> As swapping is no longer considered normal on modern computers, the
>> memory-disk duality doesn't seem all that practical anymore. Rather,
>> you'd like to treat the disk analogously to network access and keep
>> RAM access separate.
> Yep. But opening disk files that way seems to require threads or extra
> processes.

At the moment, yes. But in the ideal world, everything would be
(optionally) nonblocking. So open(O_NONBLOCK) would return a file
descriptor before the system knows if the requested pathname refers to a
valid file.

Or maybe we should introduce a new "socket" family: AF_FILE. You would

    f = socket.socket(socket.AF_FILE, socket.SOCK_STREAM, "rwb")
    except socket.error as e:
        if e.errno != errno.EINPROGRESS:


More information about the Python-list mailing list