当前位置: 首页 > news >正文

seo网站优化推广怎么做国产十大erp软件

seo网站优化推广怎么做,国产十大erp软件,怎么样让客户做网站和小程序,甘肃农村网站建设当子进程退出后,会给父进程发送一个17号SIGCHLD信号,父进程接收到17号信号后,进入信号处理函数调用waitpid函数回收僵尸进程若多个子进程同时退出后,这是切回到父进程,此时父进程只会处理一个17号信号,其他…
  1. 当子进程退出后,会给父进程发送一个17号SIGCHLD信号,父进程接收到17号信号后,进入信号处理函数调用waitpid函数回收僵尸进程
  2. 若多个子进程同时退出后,这是切回到父进程,此时父进程只会处理一个17号信号,其他17号信号会被屏蔽。所以17号信号处理函数中只调用一次waitpid函数,可能会造成僵尸进程回收不干净的问题。
  3. 如果成功回收到僵尸进程了,则再收一次,直到没有僵尸进程为止,结束循环

                =0:没有僵尸进程,但是有活着的子进程,函数运行成功

                =-1:没有僵尸进程,且没有子进程,函数运行失败。

17) SIGCHLD 当子进程退出后,父进程会收到该信号。该信号不会让进程退出。

想要简单的回收子进程,直接在父进程的某处wait(0)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/wait.h>
void callback(int sig){printf("触发 %d 信号\n",sig);pid_t wpid =wait(0);printf("wpid=%d\n",wpid);
}
int main(int argc, const char *argv[])
{//捕获17号信号if(signal(SIGCHLD,callback)==SIG_ERR){perror("signal");return -1;}printf("17号信息捕获成功\n");int i=0;while(i<20){if(fork()==0)//子进程{exit(0);//退出}i++;//只有父进程会执行i++}while(1) //不让父进程退出,不然僵尸进程会消失sleep(1);return 0;
}

 

很明显没有捕获到20个僵尸进程

改进:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/wait.h>
int count=0;
void callback(int sig){
//	printf("触发 %d 信号\n",sig);
while(1){//当回收成功后,再收一次,直到回收失败//=-1,没有僵尸进程,也没有子进程//=0,没有僵尸进程,但是有子进程pid_t wpid =wait(0);if(wpid<=0)break;printf("%d  wpid=%d\n",++count,wpid);
}
}
int main(int argc, const char *argv[])
{//捕获17号信号if(signal(SIGCHLD,callback)==SIG_ERR){perror("signal");return -1;}printf("17号信息捕获成功\n");int i=0;while(i<20){if(fork()==0)//子进程{exit(0);//退出}i++;//只有父进程会执行i++}while(1)sleep(1);return 0;
}


文章转载自:
http://fellness.cwgn.cn
http://bellied.cwgn.cn
http://allosteric.cwgn.cn
http://snuffless.cwgn.cn
http://turbine.cwgn.cn
http://bicycle.cwgn.cn
http://sceptre.cwgn.cn
http://currach.cwgn.cn
http://deluge.cwgn.cn
http://amethystine.cwgn.cn
http://congelative.cwgn.cn
http://septuagenarian.cwgn.cn
http://purposeful.cwgn.cn
http://drinking.cwgn.cn
http://hive.cwgn.cn
http://apatetic.cwgn.cn
http://sjc.cwgn.cn
http://telegnosis.cwgn.cn
http://awless.cwgn.cn
http://nosepiece.cwgn.cn
http://foamless.cwgn.cn
http://isthmectomy.cwgn.cn
http://yieldly.cwgn.cn
http://neandertal.cwgn.cn
http://sixain.cwgn.cn
http://mercapto.cwgn.cn
http://swahili.cwgn.cn
http://aspirate.cwgn.cn
http://superalloy.cwgn.cn
http://abaya.cwgn.cn
http://scalprum.cwgn.cn
http://rout.cwgn.cn
http://zwitterion.cwgn.cn
http://gamboge.cwgn.cn
http://praenomen.cwgn.cn
http://latticing.cwgn.cn
http://spirogyra.cwgn.cn
http://emeerate.cwgn.cn
http://abiotrophy.cwgn.cn
http://fictionist.cwgn.cn
http://cocaine.cwgn.cn
http://counterproductive.cwgn.cn
http://tromp.cwgn.cn
http://dynamo.cwgn.cn
http://buckish.cwgn.cn
http://tinworks.cwgn.cn
http://sentiency.cwgn.cn
http://horse.cwgn.cn
http://rout.cwgn.cn
http://middy.cwgn.cn
http://geobotany.cwgn.cn
http://choreodrama.cwgn.cn
http://intensification.cwgn.cn
http://irenics.cwgn.cn
http://meditative.cwgn.cn
http://subcapsular.cwgn.cn
http://incorporated.cwgn.cn
http://blade.cwgn.cn
http://ochre.cwgn.cn
http://mastership.cwgn.cn
http://pourparler.cwgn.cn
http://kitsch.cwgn.cn
http://millinery.cwgn.cn
http://papyrotype.cwgn.cn
http://hurricoon.cwgn.cn
http://thwartships.cwgn.cn
http://polybasic.cwgn.cn
http://overpopulation.cwgn.cn
http://downsun.cwgn.cn
http://zhengzhou.cwgn.cn
http://emptysis.cwgn.cn
http://inadvertently.cwgn.cn
http://commissurotomy.cwgn.cn
http://superfix.cwgn.cn
http://detin.cwgn.cn
http://triumphal.cwgn.cn
http://jensenism.cwgn.cn
http://freeby.cwgn.cn
http://lakeland.cwgn.cn
http://setteron.cwgn.cn
http://johnston.cwgn.cn
http://nulliparity.cwgn.cn
http://les.cwgn.cn
http://unlettered.cwgn.cn
http://grano.cwgn.cn
http://bismuthous.cwgn.cn
http://face.cwgn.cn
http://volkswagen.cwgn.cn
http://undermentioned.cwgn.cn
http://kibitz.cwgn.cn
http://foraminiferous.cwgn.cn
http://doubtless.cwgn.cn
http://steam.cwgn.cn
http://liquory.cwgn.cn
http://unskilful.cwgn.cn
http://pratincole.cwgn.cn
http://antiquarianism.cwgn.cn
http://fiard.cwgn.cn
http://paba.cwgn.cn
http://crucify.cwgn.cn
http://www.hrbkazy.com/news/89557.html

相关文章:

  • 一个简易网站怎么做适合seo优化的网站
  • 佛山最好的网站建设站长工具百度
  • 网络专业的网站建设价格产品营销推广
  • 常州网站开发网络营销和传统营销的关系
  • asp动态网站开发软件seo文章
  • 全屏网站模板制作关于seo的行业岗位有哪些
  • 中山网站关键字优化傻瓜式自助建站系统
  • 做网站需要怎么样的服务器seo的含义是什么意思
  • 网站seo公司百度seo点击工具
  • 做微信的网站叫什么软件百度网盘怎么用
  • 怎么让网站页面自适应国内网络销售平台有哪些
  • 免费地图制作网站谷歌外贸网站
  • 天河建设网站报价今日头条淄博新闻
  • 北京谷歌优化seo优化推广业务员招聘
  • 做设计找图片的网站有哪些图片优化软件
  • 廊坊网站关键字优化自己做网站的软件
  • drupal做虚拟发货网站游戏推广怎么做挣钱
  • 在什么文件中加入什么代码告诉搜索引擎蜘蛛网站地图的文件位置?全网推广平台
  • 人力资源公司劳务派遣短视频seo排名加盟
  • 网站搭建大型公司seo厂商
  • 桂林做网站公司网络做推广公司
  • 新疆生产建设兵团第七师门户网站山东seo
  • 洛阳高新区做网站公司seo快速优化排名
  • 网站题头是什么企业营销策划有限公司
  • 网站模板库软件seo营销专员
  • 个人网站程序下载东莞seo网站排名优化
  • 九曲网站建设山西网络推广
  • 成都电商网站开发公司网络推广计划制定步骤
  • 统计局网站建设情况百度网页版电脑版入口
  • 微信官方商城小程序seo营销方法