文件名称:操作系统实验
-
所属分类:
- 标签属性:
- 上传时间:2019-05-01
-
文件大小:1kb
-
已下载:2次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1. 在linux下编写一个应用程序,命名为an_ch2_1b。这个程序不断地输出如下行:
Those output come from child,[系统时间]
另外写一个应用程序,命名为an_ch2_1a。这个程序创建一个子进程,执行an_ch2_1b。这个程序不断地输出如下行:
Those output come from child,[系统时间]
观察程序运行的结果,并对你看到的现象进行解释。
2. 在linux环境下编写一个控制台应用程序,程序中有一个共享的整型变量shared_var,初始值为0;创建一个线程并使其立即与主线程并发执行。新创建的线程与主线程 均不断地循环,并输出shared_var 的值。主线程在循环中不断地对shared_var 进行加1操作,即每次循环shared_var 被加1;而新创建的线程则不断地对shared_var 进行减1 操作,即每次循环shared_var 被减1。观察程序运行的结果,并对你看到的现象进行解释。(Write an application under linux, named an_ch2 1b. The program continuously outputs the following lines:
Those output come from child, [system time]
Write another application named an_ch2_1a. This program creates a subprocess to execute an_ch2_1b. The program continuously outputs the following lines:
Those output come from child, [system time]
Observe the results of the program and explain the phenomena you see.)
Those output come from child,[系统时间]
另外写一个应用程序,命名为an_ch2_1a。这个程序创建一个子进程,执行an_ch2_1b。这个程序不断地输出如下行:
Those output come from child,[系统时间]
观察程序运行的结果,并对你看到的现象进行解释。
2. 在linux环境下编写一个控制台应用程序,程序中有一个共享的整型变量shared_var,初始值为0;创建一个线程并使其立即与主线程并发执行。新创建的线程与主线程 均不断地循环,并输出shared_var 的值。主线程在循环中不断地对shared_var 进行加1操作,即每次循环shared_var 被加1;而新创建的线程则不断地对shared_var 进行减1 操作,即每次循环shared_var 被减1。观察程序运行的结果,并对你看到的现象进行解释。(Write an application under linux, named an_ch2 1b. The program continuously outputs the following lines:
Those output come from child, [system time]
Write another application named an_ch2_1a. This program creates a subprocess to execute an_ch2_1b. The program continuously outputs the following lines:
Those output come from child, [system time]
Observe the results of the program and explain the phenomena you see.)
相关搜索: 操作系统实验
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
an_ch2_1a.cpp | 258 | 2019-04-06 |
an_ch2_1b.cpp | 447 | 2019-04-06 |
Consoleapp.c | 472 | 2019-04-06 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.