Question: Operating System Example: An execution of program 1 produces a process tree, an output, and process identifier assignment as shown in Figure 1. The parent

 Operating System Example: An execution of program 1 produces a processtree, an output, and process identifier assignment as shown in Figure 1.The parent process identifier is assumed to have been assigned with an

Operating System

Example: An execution of program 1 produces a process tree, an output, and process identifier assignment as shown in Figure 1. The parent process identifier is assumed to have been assigned with an integer 21, while the child is assigned with the next available identifier ie 22. program 1 Figure 1: Process tree of program 1 Q1: Draw a process tree (as in Figure 1) to illustrate parent-child relationship for the C code given in program 2. For each node on the tree, write the following information: i. The process identifier (assumed that the parent process identifier is assigned with an integer 21). ii. The return value of the fork 0 statement iii. Generated output Q2: Referring to Figure 2, write a program that will create five processes called original, clone1, clone2, clone3, and clone4. Each process displays message that illustrate the parent - child/children relationship between two processes. i. Process original will print an output as follows: (8 points) (2.5 points) "I am the original process, my process identifier is id of original, my clones are: process clone1: id_of_clonel process clone3;id_of_clone 33" ii. Process clonel will print an output as follow: (1.5 points) "I am the obsolete version, recent version is id_of_clone 2 " Process clone4 will print the following message: (1.5 points) "I am the most sophisticated clone, process identifier of my parent is id_of_clone 3" Write down your code on the space provided. Compile your code on Linux environment and determine the identifier of the following processes by fill in the following blanks: (0.5 point each) a. original process b. clonel process c. clone 2 process d. clone 3 process e. clonet process

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!