Write a c program for unix that creates several processes

Assignment Help C/C++ Programming
Reference no: EM133424532

Processes in UNIX

Write a C program for UNIX that creates several processes, according to the following scenario:

• The initial process will be called the parent process (P)
• The parent process (P) creates two child processes, let's call them Child1 and Child2
• The first child process (Child1) creates another process, GrandChild1
• The second child process (Child2) creates another process, GrandChild2 More precisely, the following list describes the behavior of each process:

1. Process P will create process Child1, then will immediately create process Child2 and then will wait for both child processes to finish their execution; in the end it will display the message "I am the Parent process and my pid is ... . Both my children finished their execution." (the ellipsis stand for the actual pid value which should be an integer number)

2. Process Child1 will create process GrandChild1, will wait for process GrandChild1 to finish its execution, and then will display the message "I am the process Child1 and my pid is ... ." (the ellipsis stand for the actual pid value which should be an integer number)

3. Process Child2 will create process GrandChild2, will wait for process GrandChild2 to finish its execution, and then will display the message "I am the process Child2 and my pid is ... ." (the ellipsis stand for the actual pid value which should be an integer number)

4. Process GrandChild1 will display the message "I am the process GrandChild1 and my pid is ... . My parent is process Child1 and it has the following pid: ... ." (the ellipsis stand for actual pid values which should be integer numbers)

5. Process GrandChild1 will display the message "I am the process GrandChild1 and my pid is ... . My parent is process Child1 and it has the following pid: ... ." (the ellipsis stand for actual pid values which should be integer numbers)

HINTS:
- The "fork()" system call is used to create a new process
- The "fork()" system call may return an error code, which should be detected and reported
- The "wait()" system call is used when waiting for a child process to finish is execution

Reference no: EM133424532

Questions Cloud

Command system is implemented at local level : After a disaster occurs, the Incident Command System is implemented at the local level. I
The intuitive form of artificial intelligence requires : The Intuitive form of artificial intelligence requires. Correctly complete the following sentence. Concurrent engineering is.
What legal principles can john and the family use : What legal principles can John and the family use in their claims? What could the Canadian National Exhibition have done to prevent this lawsuit?
Summarize one empirical test that supports the theory : Describe its tenets Summarize one empirical test that supports the theory Identify its strengths and weaknesses
Write a c program for unix that creates several processes : Write a C program for UNIX that creates several processes - process GrandChild2 to finish its execution, and then will display the message I am the process
What duty of honesty do you owe regarding the handling : what duty of honesty do you owe regarding the handling of funds held in trust by the law firm for which you work in probate, estate, and trust administration
Explanation about the laws that impact salary : Summary analysis of the company's competitor (Apple, Inc) Summary of your proposed plans for arbitration and negotiating for your company Summary of expected
Concepts of gerontology care and services : Outline Multifaceted and collaborative concepts of gerontology care and services
Principles of scientific management : With the Principles of Scientific Management by Taylor try to explain scientific management.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd