文件名称:zzc
介绍说明--下载内容均来自于网络,请自行研究使用
1)进程的创建:
编写一段程序,使用系统调用fork() 创建两个子进程。当此程序运行时,在系统中有一个父进程和两个子进程活动。让每一个进程在屏幕上显示一个字符:父进程显示字符“a”,子进程分别显示字符“b”和“c”。试观察记录屏幕上的显示结果,并分析原因。
(2)进程的控制
修改已经编写的程序,将每个进程输出一个字符改为每个进程输出一句话,再观察程序执行时屏幕上出现的现象,并分析原因。
如果在程序中使用系统调用lockf () 来给每一个进程加锁,可以实现进程之间的互斥,观察并分析出现的现象。
(3)
a) 编写一段程序,使其实现进程的软中断通信。
要求:使用系统调用fork() 创建两个子进程,再用系统调用signal() 让父进程捕捉键盘上来的中断信号(即按DEL键);当捕捉到中断信号后,父进程用系统调用Kill() 向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止:
-1) The process of creation: write a program using the system call fork () to create two sub-processes. When this program runs, the system has a parent and two child activities. Let each process a character on the screen: the parent shows the character "a", the child characters are shown "b" and "c". Test observations display the results on the screen, and analyze the reasons. (2) process control changes have been prepared by the procedure to output a character to each process for each process output word, and then observe the program execution when the phenomenon appears on the screen, and analyze the reasons. If the program using system calls lockf () to lock to each process, you can achieve mutual exclusion between processes to observe and analyze phenomena. (3) a) write a program to attain the soft interrupt the process of communication. Requirements: to use the system call fork () to create two sub-processes, then the system call signal () to parent up to capture the keyboard inter
编写一段程序,使用系统调用fork() 创建两个子进程。当此程序运行时,在系统中有一个父进程和两个子进程活动。让每一个进程在屏幕上显示一个字符:父进程显示字符“a”,子进程分别显示字符“b”和“c”。试观察记录屏幕上的显示结果,并分析原因。
(2)进程的控制
修改已经编写的程序,将每个进程输出一个字符改为每个进程输出一句话,再观察程序执行时屏幕上出现的现象,并分析原因。
如果在程序中使用系统调用lockf () 来给每一个进程加锁,可以实现进程之间的互斥,观察并分析出现的现象。
(3)
a) 编写一段程序,使其实现进程的软中断通信。
要求:使用系统调用fork() 创建两个子进程,再用系统调用signal() 让父进程捕捉键盘上来的中断信号(即按DEL键);当捕捉到中断信号后,父进程用系统调用Kill() 向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止:
-1) The process of creation: write a program using the system call fork () to create two sub-processes. When this program runs, the system has a parent and two child activities. Let each process a character on the screen: the parent shows the character "a", the child characters are shown "b" and "c". Test observations display the results on the screen, and analyze the reasons. (2) process control changes have been prepared by the procedure to output a character to each process for each process output word, and then observe the program execution when the phenomenon appears on the screen, and analyze the reasons. If the program using system calls lockf () to lock to each process, you can achieve mutual exclusion between processes to observe and analyze phenomena. (3) a) write a program to attain the soft interrupt the process of communication. Requirements: to use the system call fork () to create two sub-processes, then the system call signal () to parent up to capture the keyboard inter
(系统自动生成,下载前可以参看下载内容)
下载文件列表
08211480-赵梓淳\1.cpp
...............\1.exe
...............\LRU FIFO REPORTMENT.docx
...............\未命名.jpg
08211480-赵梓淳
...............\1.exe
...............\LRU FIFO REPORTMENT.docx
...............\未命名.jpg
08211480-赵梓淳