linux应用程序的编写实验原理,操作系统实验 1.在linux下编写一个应用程序 联合开发网 - pudn.com...

操作系统实验

所属分类:Linux/Unix编程

开发工具:C/C++

文件大小:1KB

下载次数:3

上传日期:2019-05-01 20:34:21

上 传 者:烟雨南风起

说明:  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.)

近期下载者:

相关文件:

收藏者:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值