摘要:
开始先给 shmem.c 中增加代码(用来打印全局变量 ShmemIndex)void getmemPointer(){ fprintf(stderr,"ShmemIndex ShmemIndex is %ld \n", ShmemIndex); return;}然后,分别在 bgwriter.c 和 walwriter.c 中,增加如下代码:/* * Main entry point for bgwriter process * * This is invoked from AuxiliaryProcessMain, which has already created t 阅读全文
摘要:
开始/* * InitShmemIndex() --- set up or attach to shmem index table. */ void InitShmemIndex(void) { HASHCTL info; int hash_flags; ... 阅读全文
摘要:
开始从 CreateSharedMemoryAndSemaphores开始:对于 Postmaster 的各个子进程而言,内存结构在 Postmaster 中已经建立,只是需要挂到各子进程自己的本地变量上。/* * CreateSharedMemoryAndSemaphores * Creates and initializes shared memory and semaphores. * ... 阅读全文
摘要:
开始基本上:AuxiliaryProcessMain -->BaseInit -->InitCommunication -->CreateSharedMemoryAndSemaphoresAuxiliaryProcessMain 是各个后台进程(bgwriter等)的调用起始点[作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]/* * AuxiliaryProcessMain * * The main entry point for ... 阅读全文
摘要:
开始在postmaster.c 中的 BackendStartup 中,有如下的代码:其中定义了 IsUnderPostmaster=true。而bgwriter 作为 postmaster 的子进程,它的 IsUnderPostmaster 也是为真。 * BackendStartup -- start backend process * * returns: STATUS_ERROR if the fork failed, STATUS_OK otherwise. * * Note: if you change this code, also consider StartAutovacuu 阅读全文
摘要:
开始pg_lath.c 是后期生成的。configure 脚本中有如下的信息:# Select latch implementation type.if test "$PORTNAME" != "win32"; then LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c"else LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c"fiac_config_links="$ac_config_link 阅读全文