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

necessary conditions for a deadlock , Q) a. Given that the first three nec...

Q) a. Given that the first three necessary conditions for a deadlock are in place, comment on the feasibility of the following strategy. All processes are given  unique priorities.

What is an i/o subsystem, What is an I/O subsystem? The control of devi...

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Because I/O deices differ widely in their function

What are the objectives for a file management system, What are the objectiv...

What are the objectives for a file management system? To meet the data management wants and requirements of the user, which embrace storage of data and the ability to

Crank-nicolson timestepping schemes, For the heat conduction problem, inves...

For the heat conduction problem, investigate the effects on the numerical solution of the following aspects: 1. non-uniform meshes with re?nement at both ends versus a uniform m

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

How does communication takes place in a distributed system?, How does commu...

How does communication takes place in a distributed system? Distributed systems depend on the networking for their functionality. A network is a communication path among two

What is the use of the command interpreter, Q. What is the use of the comma...

Q. What is the use of the command interpreter? Why is it generally separate from the kernel? Answer: It reads commands from the user or else from a file of commands and execu

Malloc, I need help implementing malloc

I need help implementing malloc

Write a short note on peer-to-peer computing, Write a short note on peer-to...

Write a short note on peer-to-peer computing. Peer-to-peer (P2P) system model is a kind of distributed OS. In this model, clients and servers aren't distinguished from one anot

How can deadlocks be represented?, How can deadlocks be represented? D...

How can deadlocks be represented? Deadlocks are able to be described in terms of a directed graph called as a system resource-allocation graph. This graph contains of the foll

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