Re: libpq read/write - Mailing list pgsql-general

From Tom Lane
Subject Re: libpq read/write
Date
Msg-id 19687.1553955434@sss.pgh.pa.us
Whole thread Raw
In response to libpq read/write  (Samuel Williams <space.ship.traveller@gmail.com>)
Responses Re: libpq read/write
List pgsql-general
Samuel Williams <space.ship.traveller@gmail.com> 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 PQisBusy).

If the library were being written from scratch today, I doubt anybody
would bother with that; it'd make more sense for an application to
use a separate thread for the database interaction, if there were
other things it needed to pay attention to concurrently.  But it is
what it is.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Required postgreSQL 10.4 version for Suse enterprise
Next
From: David Steele
Date:
Subject: Re: Regarding pgaudit log_directory