From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: access/parallel.h lacks PGDLLIMPORT |
Date: | 2017-12-19 08:36:48 |
Message-ID: | CAA4eK1LERTfovMP+gicG8Kcgs+f6R4m+2y-vn5ZGPRvL44Kf3A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Dec 14, 2017 at 8:42 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Dec 13, 2017 at 8:19 PM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
>> I suppose that extensions are supposed to be allowed to use the
>> facilities in access/parallel.h. I noticed in passing when I wrote a
>> throwaway test harness that my Windows built drone complained:
>>
>> test_sharedtuplestore.obj : error LNK2001: unresolved external symbol
>> ParallelWorkerNumber
>> [C:\projects\postgres\test_sharedtuplestore.vcxproj]
>> .\Release\test_sharedtuplestore\test_sharedtuplestore.dll : fatal
>> error LNK1120: 1 unresolved externals
>> [C:\projects\postgres\test_sharedtuplestore.vcxproj]
>>
>> I suppose that all three of these might need that, if they're part of
>> the API for parallel worker management:
>>
>> extern volatile bool ParallelMessagePending;
>> extern int ParallelWorkerNumber;
>> extern bool InitializingParallelWorker;
>>
>> I'm less sure about the other two but at least ParallelWorkerNumber is
>> essential for anything that needs to coordinate access to input/output
>> arrays or similar.
>
> I can't really think of a reason for extensions to need to access
> ParallelMessagePending. InitializingParallelWorker could be useful if
> the extension is doing something strange with custom GUCs.
> ParallelWorkerNumber is useful for the reason you state.
>
I also think it is good to allow ParallelWorkerNumber to be used in
extensions. Attached is the patch for same. I think for other two we
should wait till there is really a good use case for them.
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
Attachment | Content-Type | Size |
---|---|---|
dllimport_parallelworkernum_v1.patch | application/octet-stream | 487 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Nikhil Sontakke | 2017-12-19 08:37:41 | Re: [HACKERS] logical decoding of two-phase transactions |
Previous Message | Kyotaro HORIGUCHI | 2017-12-19 08:31:38 | Re: Protect syscache from bloating with negative cache entries |