Re: libpq read/write

2019-03-30 Thread Samuel Williams
Tom, you seem to know everything related to Postgres, so thanks for your time and answers. I'm blown away by your dedication and knowledge. Regarding PQisBusy, and similar, even for "non-blocking" behaviour, you are essentially expecting the user to have their own event loop, and only invoke the r

Re: libpq read/write

2019-03-30 Thread Tom Lane
Samuel Williams writes: > I've been doing some profiling and I was surprised to see that libpq uses > epoll when handling what essentially amounts to blocking reads/writes. Yup. > I was just wondering why it needed to be so complicated? So that we can also support nonblocking behavior (cf PQisB

libpq read/write

2019-03-30 Thread Samuel Williams
I've been doing some profiling and I was surprised to see that libpq uses epoll when handling what essentially amounts to blocking reads/writes. https://github.com/postgres/postgres/blob/fc22b6623b6b3bab3cb057ccd282c2bfad1a0b30/src/backend/libpq/pqcomm.c#L207-L227 https://github.com/postgres/post