Re: access/parallel.h lacks PGDLLIMPORT

2017-12-19 Thread Craig Ringer
On 19 December 2017 at 23:24, Robert Haas  wrote:

> On Tue, Dec 19, 2017 at 3:36 AM, Amit Kapila 
> wrote:
> > 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.
>
> I think waiting for a "really good" use case is too high a bar.  I
> think we only need to think that there is a "reasonable" use case.
> Accordingly, I pushed a commit adding PGDLLIMPORT to both
> ParallelWorkerNumber and InitializingParallelWorker.
>

Especially since  all non-static *functions* are exported unconditionally,
so it's not like we set a high bar for public API.

-- 
 Craig Ringer   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: access/parallel.h lacks PGDLLIMPORT

2017-12-19 Thread Robert Haas
On Tue, Dec 19, 2017 at 3:36 AM, Amit Kapila  wrote:
> 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.

I think waiting for a "really good" use case is too high a bar.  I
think we only need to think that there is a "reasonable" use case.
Accordingly, I pushed a commit adding PGDLLIMPORT to both
ParallelWorkerNumber and InitializingParallelWorker.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



access/parallel.h lacks PGDLLIMPORT

2017-12-13 Thread Thomas Munro
Hi hackers,

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.

-- 
Thomas Munro
http://www.enterprisedb.com