Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I try to solve this problem but I do not nothing please help me 08 (20 points) In create several child processes. Note that forkO

I try to solve this problem but I do not nothing please help me

image text in transcribed

08 (20 points) In create several child processes. Note that forkO system call is available in Ueix, POSIX (Li and MAC OS) based operating systems, but not in W ndows. For those of you wbo are un and insta Cygwin, a large a Linux distribution en Windows (the official web site for Cygwin is on the of GNU and Open Source tools which provide http:www.edparrish neticomeon/cozwin.php Windows users provided by Cygwin, and compile them with the gee compiler tlat comes with the Cywn the same interface (note that Windows users won't be able to use Code Blocks as the development enviconment for this assignment Write a C peopam which crales (forks) a child process, which in turn creates its own duid process (ie, gnedchld of the first process). The created processes should behave a child process, which in tun own duild The grandchild should print the following message ce the cossole, and then exits I am the grandchild of precess X, and the child of process Y . The child peocess should print the following message on the consele, wait for its child process, and then exits 1 am the child peocess. My Process ID is Y 1 am the child of peocess X, and the parent of process Z . The first process should print the ollowing message on the console, wait for its child peocess, and then exits I am the parest precess, My Precess ID is X I am the parent of process Y. I don't know my grandchild's process id where X. Y, and Z are the peocess id's of the parenn, child, and grandchild precesses, respectively. You should consult some sysiem calls in order to get the process id's of processes Make sure that the process id values printed by the processes are consistessie, the X, Y, and z values printed by all of the processes should be equal How the grandchild process can know its grandparent's process id, while the grandparent peocess can not know its grandchild's process id? How the child peocess knows both its parent's and child's peocess id's? Please explaim Boaus: Run your program several times You would that the order of the lines printed b the console may differ from one ran to another Why? What changes you should do an your program code so that the order of the lines printed by the peocesses are always the same te g, first grandchild's output, then, child's output, and finally the parenk's outputj your processes oa 08 (20 points) In create several child processes. Note that forkO system call is available in Ueix, POSIX (Li and MAC OS) based operating systems, but not in W ndows. For those of you wbo are un and insta Cygwin, a large a Linux distribution en Windows (the official web site for Cygwin is on the of GNU and Open Source tools which provide http:www.edparrish neticomeon/cozwin.php Windows users provided by Cygwin, and compile them with the gee compiler tlat comes with the Cywn the same interface (note that Windows users won't be able to use Code Blocks as the development enviconment for this assignment Write a C peopam which crales (forks) a child process, which in turn creates its own duid process (ie, gnedchld of the first process). The created processes should behave a child process, which in tun own duild The grandchild should print the following message ce the cossole, and then exits I am the grandchild of precess X, and the child of process Y . The child peocess should print the following message on the consele, wait for its child process, and then exits 1 am the child peocess. My Process ID is Y 1 am the child of peocess X, and the parent of process Z . The first process should print the ollowing message on the console, wait for its child peocess, and then exits I am the parest precess, My Precess ID is X I am the parent of process Y. I don't know my grandchild's process id where X. Y, and Z are the peocess id's of the parenn, child, and grandchild precesses, respectively. You should consult some sysiem calls in order to get the process id's of processes Make sure that the process id values printed by the processes are consistessie, the X, Y, and z values printed by all of the processes should be equal How the grandchild process can know its grandparent's process id, while the grandparent peocess can not know its grandchild's process id? How the child peocess knows both its parent's and child's peocess id's? Please explaim Boaus: Run your program several times You would that the order of the lines printed b the console may differ from one ran to another Why? What changes you should do an your program code so that the order of the lines printed by the peocesses are always the same te g, first grandchild's output, then, child's output, and finally the parenk's outputj your processes oa

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions