Re: libpq read/write
| От | Tom Lane |
|---|---|
| Тема | Re: libpq read/write |
| Дата | |
| Msg-id | 19687.1553955434@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | libpq read/write (Samuel Williams <space.ship.traveller@gmail.com>) |
| Ответы |
Re: libpq read/write
|
| Список | 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 по дате отправления: