Chris Angelico <ros...@gmail.com>: > On Tue, Nov 28, 2017 at 11:52 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> The original poster's problem seems to be caused by blocking APIs that >> cannot be multiplexed using select(). A good many Python facilities are >> the same way. >> >> Such blocknoxious APIs are at the core of the multithreading programming >> paradigm. > > Some things are fundamentally not multiplexable, at the lower levels.
Said function is not. Neither are, say, database methods or web operations. Yet, they are commonly implemented in a blocking fashion. > (On Linux, and I believe most other Unix-like operating systems, > there's no non-blocking way to open a file, nor to gethostbyname.) The file access problem is a fundamental glitch in Linux, but gethostbyname() is just a silly POSIX API. > How do you propose to solve those in Python? I have solved the gethostbyname() problem by implementing the DNS protocol myself (in Python). The file access issue is philosophically somewhat deep; Linux essentially treats files as memory and vice versa. If it became an issue, I'd have to launch a file server process. > I don't understand why you keep insisting that asyncio and threads are > somehow incompatible, Where did I say that? Marko -- https://mail.python.org/mailman/listinfo/python-list