2016年11月30日

Linux Linux程序练习十四(多进程压力测试)

摘要: /* * 题目: * 编程一个基本多进程测试框架,提示用户输入进程数、和每个进程数运行圈数。(fork) * 进行多进程压力测试。(execve) * 要求父进程能监控所有子进程的退出,避免僵尸进程。(wait) * */ #include <stdio.h> #include <stdlib.h> 阅读全文

posted @ 2016-11-30 22:58 寒魔影 阅读(1012) 评论(0) 推荐(0)

Linux Linux程序练习十三(信号阻塞,捕获)

摘要: /* * 题目: * 请编写一个程序,设置SIGINT和SIGQUIT信号, * 并在该程序中实现从文件中读取信息的操作, * 并保证在读取文件且只有在读取文件的过程中不会被发送的SIGINT和SIGQUIT信号所打断。 * 提示:在文件读取前阻塞信号,在文件读取后解除阻塞。 * */ #include #include #include #include #include ... 阅读全文

posted @ 2016-11-30 22:25 寒魔影 阅读(678) 评论(0) 推荐(0)

Linux 网络编程详解二(socket创建流程、多进程版)

摘要: netstat -na | grep "8080" --查看TCP/IP协议连接状态 //socket编程提高版--服务器 #include #include #include #include #include #include #include #include int main(int arg, char *args[]) { int sockfd = soc... 阅读全文

posted @ 2016-11-30 14:04 寒魔影 阅读(2067) 评论(0) 推荐(0)

导航