Re: Dynamic shared memory areas
От | Robert Haas |
---|---|
Тема | Re: Dynamic shared memory areas |
Дата | |
Msg-id | CA+TgmoZpSA21XUykhYb8mpO5t97=vxHeaAEobFawHgnkMrJMXg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Dynamic shared memory areas (Thomas Munro <thomas.munro@enterprisedb.com>) |
Ответы |
Re: Dynamic shared memory areas
|
Список | pgsql-hackers |
On Wed, Nov 23, 2016 at 7:07 AM, Thomas Munro <thomas.munro@enterprisedb.com> wrote: > Those let you create an area in existing memory (in a DSM segment, > traditional inherited shmem). The in-place versions will stlll create > DSM segments on demand as required, though I suppose if you wanted to > prevent that you could with dsa_set_size_limit(area, size). One > complication is that of course the automatic detach feature doesn't > work if you're in some random piece of memory. I have exposed > dsa_on_dsm_detach, so that there is a way to hook it up to the detach > hook for a pre-existing DSM segment, but that's the caller's > responibility. shm_mq_attach() made the opposite decision about how to solve this problem, and frankly I think that API is a lot more convenient: if the first argument to shm_mq_attach() happens to be located inside of a DSM, you can pass the DSM as the second argument and it registers the on_dsm_detach() hook for you. If not, you can pass NULL and deal with it in some other way. But this makes the common case very simple. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: