900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > linux应用程序的编写实验原理 操作系统实验 1.在linux下编写一个应用程序 联合开发

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

时间:2024-06-19 10:20:57

相关推荐

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

操作系统实验

所属分类:Linux/Unix编程

开发工具:C/C++

文件大小:1KB

下载次数:3

上传日期:-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.)

近期下载者:

相关文件:

收藏者:

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。