Re: Shared Memory hash tables only at startup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: hariprasath nallasamy <hariprasathnallasamy(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shared Memory hash tables only at startup
Date: 2017-05-02 12:32:57
Message-ID: 28131.1493728377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hariprasath nallasamy <hariprasathnallasamy(at)gmail(dot)com> writes:
> *(In practice, all creations are done in the postmasterprocess; child
> processes should always be attaching to existing tables.)*

Yeah ...

> Is there any specific reason to do so or my understanding was wrong(we can
> create shared memory hash table at run time too?)

Well, if you don't mind resolving the race conditions that you're going to
have, you could possibly do that. In practice though, unless it's a very
small hash table, it's going to need to be accounted for in the sizing
calculations in CreateSharedMemoryAndSemaphores, which means you might
as well create it during that function too.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2017-05-02 12:40:55 Re: CTE inlining
Previous Message Peter Eisentraut 2017-05-02 12:30:59 Re: logical replication and PANIC during shutdown checkpoint in publisher