Re: Win32 open items - Mailing list pgsql-patches

From Tom Lane
Subject Re: Win32 open items
Date
Msg-id 6658.1099160779@sss.pgh.pa.us
Whole thread Raw
In response to Re: Win32 open items  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-patches
"Magnus Hagander" <mha@sollentuna.net> writes:
> Here is an attempt at this. First patch contains the changes to libpq,
> second patch contains changes to psql to use this API. Docs not updated
> yet, pending approval of the general idea at least :)

I think it would be better to dispense with the PQgetCancelError
function and just make the signature of PQcancel be
    int PQcancel(PGcancel *cancel, char *errbuf, int errbuflen);
where errbuf would normally point to a local array in the calling
function.

As-is, PQcancel is itself not thread safe because it is scribbling
on the PGcancel struct.  I thought the whole point of this exercise
was to allow multiple threads to use the PGcancel struct; which seems
to me to imply that it had better be read-only to PQcancel.

We don't need the cancelConnLock if this is done properly (at least,
assuming that storing a pointer is atomic, which seems reasonable).

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cache last known per-tuple offsets to speed long tuple access
Next
From: "Magnus Hagander"
Date:
Subject: Re: Win32 open items