| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Gregory Stark <stark(at)enterprisedb(dot)com>, David Fetter <david(at)fetter(dot)org>, Jim Nasby <decibel(at)decibel(dot)org>, pgsql-patches <pgsql-patches(at)postgresql(dot)org> |
| Subject: | Re: Concurrent psql patch |
| Date: | 2007-05-24 21:00:00 |
| Message-ID: | 4655FCD0.90507@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bernd Helmle | 2007-05-24 22:32:01 | Reviewing temp_tablespaces GUC patch |
| Previous Message | Tom Lane | 2007-05-24 20:49:53 | Re: Concurrent psql patch |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2007-05-24 21:09:04 | Re: Configure template change to use SysV Semaphors on darwin |
| Previous Message | Tom Lane | 2007-05-24 20:49:53 | Re: Concurrent psql patch |