PG守护进程(Postmaster)——建立共享内存和信号量reset_shared_sed


reset_shared函数重置共享内存和信号量,使用port作为IPC键。如果使用SysV shmem and/or semas,在每个cycle of life中使用相同的IPC键。

/* reset_shared -- reset shared memory and semaphores */
static void reset_shared(int port) {
/* Create or re-create shared memory and semaphores.
* Note: in each "cycle of life" we will normally assign the same IPC keys
* (if using SysV shmem and/or semas), since the port number is used to
* determine IPC keys. This helps ensure that we will clean up dead IPC
* objects if the postmaster crashes and is restarted. */
CreateSharedMemoryAndSemaphores(port);
}

PG守护进程(Postmaster)——建立共享内存和信号量reset_shared_sed_02

PG守护进程(Postmaster)——建立共享内存和信号量reset_shared_共享内存_03