Assignment on Fork System Call, Operating System

Assignment Help:
Parent process P creates three child processes, C1, C2, and C3. Each child process executes a
memory and CPU intensive application of your choice. Your choice should be such that the children
execute for considerable periods of time and acquire considerable amount of memory (say, on the stack
or on the heap).
The parent process P wants to periodically monitor the status of its children to determine: • are each of the three children, C1, C2, and C3 alive? • what is the CPU utilization of each child process? • what is the memory usage of each child process?
Note that P received the PIDs of C1, C2, C3, during the fork() system call. In order to obtain the
periodic status, P does the following:
(a) It periodically forks a child, M, creates a pipe with it, and redirects the standard output of M to
the pipe (that is, when M writes to stdout it can be read by P from the pipe). The monitoring
interval can be implemented with the sleep command.
(b) Once M is created, it chooses a suitable system call from the exec family to execute the “ps”
command with suitable arguments (thereby writing its output into the pipe with its parent P).
Thereafter M terminates.
(c) P reads the output of M from the pipe, finds the entries corresponding to C1, C2, and C3 (that
is, if they are alive) and extracts their respective CPU and memory utilizations (in percentage,
as reported by “ps”). P writes the timestamp and the information extracted in the terminal.
(d) When P finds that C1, C2, and C3 are not present in the listing of “ps”, it writes “All children
have terminated” and stops.
Please study the syntax and arguments of “ps” carefully so that you execute it with the optimal set of
arguments.
You need to submit the following:
1. The C program for P
2. The applications run by C1, C2, C3. These must be made available in a form that the TA can
run your system in your absence

Related Discussions:- Assignment on Fork System Call

Removing system dependencies, Removing System Dependencies Because port...

Removing System Dependencies Because portions of the client - server application program may execute on different machines, it is very important for the developer to remove the

What are the major differences between operating systems, Q. What are the m...

Q. What are the major differences between operating systems for mainframe computers and personal computers? Answer: In general operating systems for batch systems have simpler

Describe the main architectural layers of windows xp, Q. Describe the three...

Q. Describe the three main architectural layers of Windows XP? Answer: (1) The HAL (Hardware Abstraction Layer) creates operating system portability by hiding hardware differ

Relationship among the capabilities of domain level j and i, Q. In a ring-...

Q. In a ring-protection system the level 0 has the greatest access to objects and level n (greater than zero) has fewer access rights. The access rights of a program at a partic

Explain objectives of the file management system, Problem: a) Define a ...

Problem: a) Define a ‘file' and list the objectives of the file management system. b) List the ways in which programs access files and determine for what file types you woul

Page faults, Assume there are only 4 page frames in the physical memory, fo...

Assume there are only 4 page frames in the physical memory, for the following reference string: 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2, 8. a) What i

Determine the scheduling technique, The scheduling technique in which CPU i...

The scheduling technique in which CPU is allocated to the process with least CPU-burst time is known as  Shortest job first Scheduling is a scheduling technique in which CPU i

In JavaScript, Ask quesIn JavaScript, what is event handling tion #Minimum ...

Ask quesIn JavaScript, what is event handling tion #Minimum 100 words accepted#

Write Your Message!

Captcha
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