- Notifications
You must be signed in to change notification settings - Fork5
Commit13df76a
committed
Introduce dynamic shared memory areas.
Programmers discovered decades ago that it was useful to have a simpleinterface for allocating and freeing memory, which is why malloc() andfree() were invented. Unfortunately, those handy tools don't workwith dynamic shared memory segments because those are specific toPostgreSQL and are not necessarily mapped at the same address in everycooperating process. So invent our own allocator instead. This makesit possible for processes cooperating as part of parallel queryexecution to allocate and free chunks of memory without having toreserve them prior to the start of execution. It could also be usedfor longer lived objects; for example, we could consider storing datafor pg_stat_statements or the stats collector in shared memory usingthese interfaces, rather than writing them to files. Basically,anything that needs shared memory but can't predict in advance howmuch it's going to need might find this useful.Thomas Munro and Robert Haas. The original code (of mine) on whichThomas based his work was actually designed to be a new backend-localmemory allocator for PostgreSQL, but that hasn't gone anywhere - ornot yet, anyway. Thomas took that work and performed majorrefactoring and extensive modifications to make it work with dynamicshared memory, including the addition of appropriate locking.Discussion: CA+TgmobkeWptGwiNa+SGFWsTLzTzD-CeLz0KcE-y6LFgoUus4A@mail.gmail.comDiscussion: CAEepm=1z5WLuNoJ80PaCvz6EtG9dN0j-KuHcHtU6QEfcPP5-qA@mail.gmail.com1 parent13e14a7 commit13df76a
File tree
4 files changed
+2317
-1
lines changed- src
- backend/utils/mmgr
- include/utils
- tools/pgindent
4 files changed
+2317
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
|
0 commit comments
Comments
(0)