On Wed, Apr 12, 2017 at 2:32 PM, Paul Rubin <no.email@nospam.invalid> wrote: > Chris Angelico <ros...@gmail.com> writes: >> Python, meanwhile, has made it easy to write blocking >> I/O in a single-threaded program, and then adds async'ness to it. > > I'd be interested to know how to open a disk file asynchronously in a > single-threaded Python program under Linux. As far as I can tell there > is no way to do it.
I'm not sure how Node does it. But most of JavaScript/ECMAScript has historically been aimed at web browsers, where you're not allowed to open files as such, but you _can_ make HTTP requests. It's also entirely possible to have a single "application thread" and then a "file opening thread" that does nothing but open files; your app is still single threaded (thus you don't have concurrency concerns), but file opening becomes truly asynchronous. Oh, and Python also has to cope with a bit more complexity because it's possible to start multiple application threads in Python. It's not in JS. ChrisA -- https://mail.python.org/mailman/listinfo/python-list