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

网站建设与维护属于什么岗位游戏开发平台

网站建设与维护属于什么岗位,游戏开发平台,网站seo合同,贵阳有做网站的公司吗?ps:疑惑的地方#xff0c;1 进程pcb的概念#xff0c; 还有 ulimit -a 显示的信息 是一个进程可以最大占用资源的上限吗#xff1f; 还有 文件描述符的概念#xff1f;#xff1f; 这里不是很明白#xff01;记录一下2还有WIFEXITED 孤儿进程 与僵尸进程 孤儿进程#…ps:疑惑的地方1 进程pcb的概念 还有 ulimit -a 显示的信息 是一个进程可以最大占用资源的上限吗 还有 文件描述符的概念 这里不是很明白记录一下2还有WIFEXITED 孤儿进程 与僵尸进程 孤儿进程 子进程运行父进程终止 子进程就是孤儿进程 僵尸进程进程终止父进程尚未回收子进程残留资源pcb存放于内核中变成Zombie僵尸进程 wait函数 回收子进程 man wait 看到的是命令提示 man 2 wait 看到的是函数原型pid_t wait(int *status); 作用a. 阻塞等待b. 回收子进程资源c. 查看死亡原因 #include sys/types.h #include sys/wait.h pid_t wait(int *status);status 传出参数返回值 调用成功返回终止子进程的pid调用失败返回 -1 子进程死亡原因a. 正常死亡 WIFEXITED如果WIFEXITED为真使用WEXITSTATUS 得到退出状态b. 非正常死亡如果WIFSIGNALED为真使用WTERMSJG, 得到信号 以下是代码示例 以下是 wait 于 waitpid函数 相关文档介绍 If status is not NULL, wait() and waitpid() store status information in the int to which it points. This integer can be inspected with the following macros (which take the integer itself as an argument, not a pointer to it, as is done in wait() and waitpid()!):WIFEXITED(status)returns true if the child terminated normally, that is, by calling exit(3) or _exit(2), or byreturning from main().WEXITSTATUS(status)returns the exit status of the child. This consists of the least significant 8 bits of thestatus argument that the child specified in a call to exit(3) or _exit(2) or as the argumentfor a return statement in main(). This macro should be employed only if WIFEXITED returnedtrue.WIFSIGNALED(status)returns true if the child process was terminated by a signal.WTERMSIG(status)returns the number of the signal that caused the child process to terminate. This macro shouldbe employed only if WIFSIGNALED returned true. pid_t waitpid(pid_t pid, int *status, int options);pida. -1 -组idb. -1 回收任意c. 0 回收和调用进程组id相同组内的子进程d. 0 回收指定的pidoptionsa. 0与wait相同也会阻塞b. WNOHANG 如果没有当前子进程立即退出的会立刻返回返回值a.如果设置了WNOHANG1).如果没有子进程退出返回02).如果有子进程退出返回退出的pidb. 失败返回-1没有子进程调用案例 以下是 pid_t pid 这个参数对应的不同值的介绍 ps 0 这个参数不明白是什么意思 这里记录一下 -1 meaning wait for any child process whose process group ID is equal to the absolute value ofpid.-1 meaning wait for any child process.0 meaning wait for any child process whose process group ID is equal to that of the callingprocess. 0 meaning wait for the child whose process ID is equal to the value of pid. 用wait 回收多个子进程 调用案例 用waitpid函数回收多个子进程调用案例 #include stdio.h #include sys/types.h #include sys/wait.h #include stdlib.h #include unistd.hint main() {int i;int n 5;pid_t pid;pid_t wpid;for(i0; in; i) {pid fork();if(pid 0) {break;}}if(i5) {printf(my is father progress !\n);while(1) {wpid waitpid(-1, NULL, WNOHANG);if(wpid-1) {printf(zi ji cheng hui shou wan bi\n);break;} else if (wpid0) {printf(hui shou de zi jin cheng pid is%d\n, wpid);}} while(1) {sleep(1);}}if(i5) {printf(my is son progress! my pid is%d\n, getpid());} return 0; } 创建子进程调用fork之后在子进程调用自定义程序段错误浮点型错误用waitpid回收查看退出状态 代码示例 #include stdio.h #include stdlib.h #include sys/types.h #include sys/wait.h #include unistd.hint main () {pid_t pid;pid_t wpid;int status;pid fork();if(pid0) {// zi jin chengexecl(./test3gz.out, test3gz.out, NULL);} else {while(1) {wpid waitpid(-1, status, WNOHANG);if(wpid -1) {printf(suo you zi jin cheng tui chu\n);break;} else if(wpid0) {printf(tui chu de zi jin cheng pid shi%d\n, wpid);printf(status is %d\n, status);if(WIFEXITED(status)) {printf(zheng chang tui chu return status is %d\n, WEXITSTATUS(status));}if(WIFSIGNALED(status)) {printf(zi ji cheng kill by signal is %d\n, WTERMSIG(status));}}} while(1) {sleep(1);}}return 0; }输出 a. 当test3gz.out没有发生浮点型错误的时候 this is test3gz.c k 3 tui chu de zi jin cheng pid shi18293 status is 0 zheng chang tui chu return status is 0 suo you zi jin cheng tui chu b. 当test3gz.out发生浮点型错误的时候 tui chu de zi jin cheng pid shi18278 status is 136 zi ji cheng kill by signal is 8 suo you zi jin cheng tui chu 子进程与父进程共享文件描述符表
http://wiki.neutronadmin.com/news/335975/

相关文章:

  • 有口碑的顺德网站建设有创意的网页
  • 湖州做网站优化一个品牌的策划方案
  • 仙游县网站建设南昌seo推广公司
  • 企业网站建设的费用怎么看网站的建站公司是哪个
  • 通用搭建网站教程网站建设好后怎么更新内容
  • 网站支付端口化妆品网站建设推广方案
  • wordpress 站群个人网站设计教程
  • 外贸石材网站wordpress改后台地址
  • 师范街网站建设知识库管理系统方案
  • 购物网站哪个是正品中国海外旅游营销网站
  • 个人能不能自己做网站阿里云域名注册续费
  • 社交网站先做pc站可以吗越南做企业网站
  • 企业网站建设方案应该怎么做培训美工设计师
  • 重庆靓号网站建设无锡装修网站
  • 淮南营销型网站建设怎么样山东省住房和城乡建设厅网站6
  • 廊坊企业网站建设公司凡科的网站怎么做百度推广
  • 如何将网站让百度收录网络营销试卷
  • 用c 可以做网站吗园林公司做网站的好处
  • 网站建设项目执行进度表网上注册平台怎么注册
  • 外贸营销型网站2018软件开发定制费用
  • 做网站需要的程序数据线东莞网站建设技术支持
  • 视频付费网站建设网站建设主持词
  • 凡客网站登陆东莞好的网站建设公司
  • wordpress自动发布网站深圳公司排名名字
  • 重庆企业做网站制作网站的模板下载软件
  • 青岛网站建设制作公司如何实现网站的伪静态
  • 网站博客怎么做网站活动策划怎么做
  • 长沙医考网站建设公司江苏工程造价信息网官网
  • 企业微信开放平台api朝阳seo搜索引擎
  • 网站编程培训网站开发工程师需要什么证书