Re: Concurrent psql patch - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: Concurrent psql patch
Date
Msg-id 4655FCD0.90507@dunslane.net
Whole thread Raw
In response to Re: Concurrent psql patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Concurrent psql patch  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-patches

Tom Lane wrote:
> 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
>
>
>

In that case I guess Greg has some work to do :-) .  Looks like there
are about five such calls in toto, so it's not a huge tragedy.

cheers

andrew

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Concurrent psql patch
Next
From: Tom Lane
Date:
Subject: Re: Configure template change to use SysV Semaphors on darwin