Re: Concurrent psql patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Concurrent psql patch
Дата
Msg-id 20807.1180039793@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Concurrent psql patch  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Concurrent psql patch  (Andrew Dunstan <andrew@dunslane.net>)
Re: Concurrent psql patch  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
>             if (pset.c->db->asyncStatus != PGASYNC_BUSY)
>             {
>                 break;
>             }

There already is a defined API for this, namely PQisBusy().

In any case, I rather concur with the XXX comment: busy-waiting like
this sucks.  The correct way to do this is to get the socket numbers for
the connections (via PQsocket), wait for any of them to be read-ready
according to select() (or for the timeout to elapse, assuming that we
think that behavior is good), then cycle through PQconsumeInput() and
PQisBusy() on each connection.  See
http://www.postgresql.org/docs/8.2/static/libpq-async.html

            regards, tom lane

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Concurrent psql patch
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Concurrent psql patch