Write a single program to perform the following tasks: Main process should create a child process.Both parent and child processes will create one thread (e.g. parent process à thread A, child process à thread B). Compare the ids of parent and child, parent process and thread A, parent process and thread B, child process and thread A, child process and thread B. Display appropriate messages as per your comparison results. Parent process will take a number from user as input and will pass on this number to thread A while creating it. Before doing anything else, thread A will print the cube of that number. Parent process will perform some tasks and then wait for the termination of child process. Similarly, thread B will wait for the termination of thread A before starting execution. Each process and thread will display an appropriate message before its termination. Parent process will send your Name and Registration number to the child process and you will save them in two different variables. You have to use pipes for this purpose. Later on, thread B will display these values as an output. Make sure to display appropriate messages and terminate normally using exit if there is any problem in child process/thread or p
Write a single program to perform the following tasks: Main process should create a child process.Both parent and child processes will create one thread (e.g. parent process à thread A, child process à thread B). Compare the ids of parent and child, parent process and thread A, parent process and thread B, child process and thread A, child process and thread B. Display appropriate messages as per your comparison results. Parent process will take a number from user as input and will pass on this number to thread A while creating it. Before doing anything else, thread A will print the cube of that number. Parent process will perform some tasks and then wait for the termination of child process. Similarly, thread B will wait for the termination of thread A before starting execution. Each process and thread will display an appropriate message before its termination. Parent process will send your Name and Registration number to the child process and you will save them in two different variables. You have to use pipes for this purpose. Later on, thread B will display these values as an output. Make sure to display appropriate messages and terminate normally using exit if there is any problem in child process/thread or p
Introduction to Chemical Engineering Thermodynamics
8th Edition
ISBN:9781259696527
Author:J.M. Smith Termodinamica en ingenieria quimica, Hendrick C Van Ness, Michael Abbott, Mark Swihart
Publisher:J.M. Smith Termodinamica en ingenieria quimica, Hendrick C Van Ness, Michael Abbott, Mark Swihart
Chapter1: Introduction
Section: Chapter Questions
Problem 1.1P
Related questions
Question
Write a single program to perform the following tasks:
- Main process should create a child process.Both parent and child processes will create one thread (e.g. parent process à thread A, child process à thread B).
- Compare the ids of parent and child, parent process and thread A, parent process and thread B, child process and thread A, child process and thread B. Display appropriate messages as per your comparison results.
- Parent process will take a number from user as input and will pass on this number to thread A while creating it. Before doing anything else, thread A will print the cube of that number.
- Parent process will perform some tasks and then wait for the termination of child process. Similarly, thread B will wait for the termination of thread A before starting execution. Each process and thread will display an appropriate message before its termination.
- Parent process will send your Name and Registration number to the child process and you will save them in two different variables. You have to use pipes for this purpose. Later on, thread B will display these values as an output.
- Make sure to display appropriate messages and terminate normally using exit if there is any problem in child process/thread or pipe creation.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, chemical-engineering and related others by exploring similar questions and additional content below.Recommended textbooks for you
Introduction to Chemical Engineering Thermodynami…
Chemical Engineering
ISBN:
9781259696527
Author:
J.M. Smith Termodinamica en ingenieria quimica, Hendrick C Van Ness, Michael Abbott, Mark Swihart
Publisher:
McGraw-Hill Education
Elementary Principles of Chemical Processes, Bind…
Chemical Engineering
ISBN:
9781118431221
Author:
Richard M. Felder, Ronald W. Rousseau, Lisa G. Bullard
Publisher:
WILEY
Elements of Chemical Reaction Engineering (5th Ed…
Chemical Engineering
ISBN:
9780133887518
Author:
H. Scott Fogler
Publisher:
Prentice Hall
Introduction to Chemical Engineering Thermodynami…
Chemical Engineering
ISBN:
9781259696527
Author:
J.M. Smith Termodinamica en ingenieria quimica, Hendrick C Van Ness, Michael Abbott, Mark Swihart
Publisher:
McGraw-Hill Education
Elementary Principles of Chemical Processes, Bind…
Chemical Engineering
ISBN:
9781118431221
Author:
Richard M. Felder, Ronald W. Rousseau, Lisa G. Bullard
Publisher:
WILEY
Elements of Chemical Reaction Engineering (5th Ed…
Chemical Engineering
ISBN:
9780133887518
Author:
H. Scott Fogler
Publisher:
Prentice Hall
Industrial Plastics: Theory and Applications
Chemical Engineering
ISBN:
9781285061238
Author:
Lokensgard, Erik
Publisher:
Delmar Cengage Learning
Unit Operations of Chemical Engineering
Chemical Engineering
ISBN:
9780072848236
Author:
Warren McCabe, Julian C. Smith, Peter Harriott
Publisher:
McGraw-Hill Companies, The