(完整word版)操作系统实验报告-观察进程的并发性.pdf

上传人:H****o 文档编号:55056075 上传时间:2022-10-29 格式:PDF 页数:8 大小:343.80KB
返回 下载 相关 举报
(完整word版)操作系统实验报告-观察进程的并发性.pdf_第1页
第1页 / 共8页
(完整word版)操作系统实验报告-观察进程的并发性.pdf_第2页
第2页 / 共8页
点击查看更多>>
资源描述

《(完整word版)操作系统实验报告-观察进程的并发性.pdf》由会员分享,可在线阅读,更多相关《(完整word版)操作系统实验报告-观察进程的并发性.pdf(8页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、计算机操作系统实验报告1 评语:课中检查完成的题号及题数:课后完成的题号与题数:成绩:指导教师:实验报告一实验名称:观察进程的并发性日期:2011.5.7 班级:学号:姓名:一、实验目的:通过创建子进程,观察父子进程的并发执行过程,区别顺序执行和并发执行;明确进程和程序的区别;加深对操作系统进程概念和进程并发特性的理解。二、实验内容:进程的创建。编制一段程序,使用系统调用fork()创建两个子进程,在此程序运行时,系统中就有一个父进程和两个子进程在活动。让每一个进程在屏幕上显示一个字符:父进程显示字符 a,两个子进程分别显示字符b和子符 c。试观察、记录并分析屏幕上进程调度和并发执行的情况。若

2、在程序中使用系统调用nice()来改变各进程的优先级,观察出现的现象.三、项目要求及分析:为了体现出进程的并发性,首先在父进程创建一个子进程,进程里利用循环方式输出字符“b”,然后在父进程里又创建子进程2,进程 2 里循环输出字符“c”,在父进程里循环输出字符“a”。这样程序运行时,父子进程之间并发执行,并输出相应的字符。对于 nice()函数的应用,我主要是先输出子进程1 的优先级,然后用nice 函数修改子进程的优先级,然后观察运行结果。对于子进程2 也用 nice 函数修改了其优先级,再观察运行结果。四、具体实现:计算机操作系统实验报告2 4.1 流程图4.2 添加函数的代码1)进程之间

3、的并发性#include#include#include#include int main()int i,j,k;int pid=fork();/new first thread if(pid=0)/first thread for(j=0;j0)/main thread int pi=fork();/new second thread if(pi=0)/second thread for(k=0;k0)/main thread for(i=0;i5;i+)printf(main:atti=%dn,i);sleep(1);waitpid(pid,0,0);/wait first thread

4、over waitpid(pi,0,0);/wait second thread over printf(main thread exitrn);exit(0);else/second thread failed perror(function fork()error!rn);exit(1);else/first thread failed perror(function fork()error!rn);exit(1);return 0;2)nice 函数的应用#include 文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7

5、 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6

6、ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档

7、编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7

8、O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H

9、6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9

10、文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10

11、P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9计算机操作系统实验报告4#include#include#include int main()int i,j,k;int oldpri,newpri;int pid=fork();/new first thread if(pid=0)/first thread printf(parentpid is%dn,getppid();oldpri=getpriority(PRIO_PR

12、OCESS,getpid();printf(first thread old priority=%dn,oldpri);newpri=nice(5);printf(first thread new priority=%dn,newpri);for(j=0;j0)/main thread int pi=fork();/new second thread if(pi=0)/second thread nice(2);for(k=0;k0)/main thread for(i=0;i5;i+)printf(main:atti=%dn,i);sleep(1);waitpid(pid,0,0);/wai

13、t first thread over waitpid(pi,0,0);/wait second thread over 文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A

14、8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:C

15、M3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 H

16、W1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV

17、3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码

18、:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7

19、 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9计算机操作系统实验报告5 printf(main thread exitrn);exit(0);else/new thread failed

20、perror(function fork()error!rn);exit(1);else/new thread failed perror(function fork()error!rn);exit(1);return 0;五、调试运行结果:1)进程之间的并发性结果文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编

21、码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O

22、7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6

23、 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文

24、档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P

25、7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8

26、H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X

27、9计算机操作系统实验报告6 父子进程并发运行的结果2)nice 函数的应用文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7

28、 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6

29、ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档

30、编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7

31、O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H

32、6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9

33、文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9计算机操作系统实验报告7 运用nice函数前后结果对比六、所遇问题及解决方法:1.对 Linux 的操作不是很熟悉,有请老师辅导。2.nice()函数之前没接触过,上网找了一些资料,对 ni

34、ce 函数有了一定的了解,在程序中我是通过改变子进程1 和子进程 2 的优先级,并且输出子进程1 优先级改变前后的大小。最后运行程序,体会nice()函数的作用。观察到在nice()函数应用前后,输出字符的顺序确实有一定的改变。体会到优先级的数值越小优先级越高,数值越大优先级越低。七、实验总结:1.通过这次试验,对 linux 的操作有了进一步的了解,深深体会到,fork()执行一次但有两个返回值。在父进程中,返回值是子进程的进程号;在子进程中,返回值为0。因此可通过返回值来判断当前进程是父进程还是子进程。使用fork 函数得到的子进程是父进程的一个复制品,它从父进程处复制了整个进程的地址空间

35、,包括进程上下文,进程堆栈,内存信息,打开的文件描述符,信号控制设定,进程优先级,进程组号,当前工作目录,根目录,资源限制,控制终端等。而子进程所独有的只是它的进程号,资源使用和计时器等。在fork()函数返回后,父子进程会根据不同的返回值执行不同的代码,一般是通过if 语句来判断是从父进程还是子进程返回。2.当首次调用新创建的子进程时,其入口一般在fork()函数返回等于零的分支里。3.nice 函数在当前程序运行优先级基础之上调整指定值得到新的程序运行优先级。优文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F

36、4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8

37、M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H

38、5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P

39、1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8

40、G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM

41、3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW

42、1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9计算机操作系统实验报告8 先级的范围为-20 19 等 40 个等级,其中数值越小优先级越高,数值越大优先级越低,既-20 的优先级最高,19的优先级最低。若调整后的程序运行优先级高于-20,则就以优先级-20 来运行命令行;若调整后的程序运行优先级低于19,则就以优先级 19 来运行命令行。若nice 命令未指定优先级的调整值,则以缺省值10 来调整程序运行优先级,既在当前程序运行优先级基

43、础之上增加10。文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:

44、CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7

45、HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 Z

46、V3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编

47、码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O

48、7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9文档编码:CM3H5Y10P7O7 HW1P1F4C8H6 ZV3A8G8M3X9

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁