Re: shmem_startup_hook called twice on Windows - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: shmem_startup_hook called twice on Windows
Date
Msg-id CAA5RZ0s4jiUW1s2t23tWg0QLRTFztwX_PFkY9dsi66Lfw13d2g@mail.gmail.com
Whole thread Raw
In response to Re: shmem_startup_hook called twice on Windows  (Sami Imseih <samimseih@gmail.com>)
Responses Re: shmem_startup_hook called twice on Windows
List pgsql-hackers
Sorry my last reply got mangled for some reason. Here it is again.

> > Blame shows that this change was introduced in commit 69d903367c,
> > but I could not determine the rationale from the discussion,
> > so it may have been an oversight.
>
> I think the startup hook must run in each backend for EXEC_BACKEND, else we
> won't properly initialize pointers to shared memory in that case,
> right? I guess the
> doc below is giving a vague warning that one should be careful what they
> put in that hook.

But that could potentially be dangerous if code in the startup hook
gets re-executed?
I guess the
doc below is giving a vague warning that one should be careful what they
put in that hook.

> > I added the following wording in commit 964152c:
>
> Thanks, I missed the doc update. Yes, that is inconsistent between platforms,
> and if we must live with this behavior, should the doc give a bigger warning
> about the code that goes in that hook?

Thanks, I missed the doc update. Yes, that is inconsistent between platforms,
and if we must live with this behavior, should the doc give a bigger warning
about the code that goes in that hook?

--
Sami



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: About Custom Aggregates, C Extensions and Memory
Next
From: Greg Burd
Date:
Subject: [PATCH] Add tests for Bitmapset