libpq read/write

Поиск
Список
Период
Сортировка
От Samuel Williams
Тема libpq read/write
Дата
Msg-id CAHkN8V_zTfF9QAwG_rrM=k6U56xvnEyNsUDi9_=vOg7UZHgF_A@mail.gmail.com
обсуждение исходный текст
Ответы Re: libpq read/write
Список pgsql-general
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


I was just wondering why it needed to be so complicated?

What's wrong with just using read/write when blocking semantics are desired? You can still restart them if they are interrupted (might not be desired default behaviour). The problem is, it's hard for me to measure "blocking" time when libpq uses epoll rather than blocking read/write.

I guess I'm not expecting to rewrite it or anything, just wondering why it's designed that way.

Kind regards,
Samuel

В списке pgsql-general по дате отправления:

Предыдущее
От: Ankit Trivedi
Дата:
Сообщение: Required postgreSQL 10.4 version for Suse enterprise
Следующее
От: Gmail
Дата:
Сообщение: Re: stale WAL files?