摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]Postmaster 作为父进程,要对很多子进程进行监控,当遇到各种信号的时候,也要适当地进行传达。/* * pmdie -- signal handler for processing various postmaster signals. */ static void ... 阅读全文
posted @ 2012-10-31 16:15 健哥的数据花园 阅读(573) 评论(0) 推荐(0)
摘要: 上代码学习网络上的文章,http://blog.sina.com.cn/s/blog_602a39250100xfxx.html 非常感谢但是和我的环境有点不一样,我简单改了改程序: [root@localhost wait]# cat waittest.c#include <sys/types.h>#include <sys/wait.h>#include <unistd.h>#include <stdio.h>#include<stdlib.h>main(){ pid_t pc, pr; pc=fork(); if(pc<0 阅读全文
posted @ 2012-10-31 13:29 健哥的数据花园 阅读(189) 评论(0) 推荐(0)
摘要: 如果 我直接 kill 掉 bgwriter 的进程,会发生什么呢?[root@localhost postgresql-9.2.0]# ps -ef|grep postroot 2928 2897 0 10:34 pts/1 00:00:00 su - postgrespostgres 2929 2928 0 10:34 pts/1 00:00:00 -bashpostgres 3101 2929 0 11:09 pts/1 00:00:00 ./postgres -D /usr/local/pgsql/datapostgres 3103 31... 阅读全文
posted @ 2012-10-31 11:16 健哥的数据花园 阅读(288) 评论(0) 推荐(0)
摘要: bgwriter.c 的代码中有如下部分: pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */[作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]还有:/* * bg_quickdie() occurs when signalled SIGQUIT by the postmaster. * * Some backend has bought the farm, * so we need to stop what we're doing and exit. */static voidbg_... 阅读全文
posted @ 2012-10-31 11:07 健哥的数据花园 阅读(530) 评论(0) 推荐(0)
摘要: 上例子 [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com][root@localhost test]# cat exem.c#include <unistd.h>#include <stdio.h>#include <stdlib.h>int main(){ pid_t mpid; mpid=fork(); if( mpid<0) { } else if (mpid==0) { //the child itself ... 阅读全文
posted @ 2012-10-31 09:39 健哥的数据花园 阅读(197) 评论(0) 推荐(0)
摘要: 我用例子来说明:只是一个模拟,我自己做的 假的 bgwriter.c[root@localhost test]# cat bgwriter.c#include<stdio.h>#include<stdlib.h>#include<signal.h>#include "bgwriter.h"#include "guc.h"//some conditions make it change, eg:signalint BgWriterDelay=100;void sighandler(int sig);int main(){ 阅读全文
posted @ 2012-10-31 08:45 健哥的数据花园 阅读(301) 评论(0) 推荐(0)
摘要: /usr/include/bits/types.h:typedef int __pid_t;/usr/include/unistd.h:typedef __pid_t pid_t; 阅读全文
posted @ 2012-10-31 08:39 健哥的数据花园 阅读(333) 评论(0) 推荐(0)