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

Compute the effective instruction time on the system, Q. An operating syst...

Q. An operating system sustains a paged virtual memory using a central processor with a cycle time of 1 microsecond. It costs an additional one microsecond to access a page other

Define the features to implement top down parsing, Define the features are ...

Define the features are needed to implement top down parsing                      Source string marker, Prediction making mechanism and Matching and Backtracking mechanism

Explain about spooling, Q. Explain about Spooling? Acronym for simu...

Q. Explain about Spooling? Acronym for simultaneous peripheral operations on line. Spooling denotes to putting jobs in a buffer, a special area in memory or on a disk where

Explain about paging, Explain about paging? Answer: Paging is a memory-...

Explain about paging? Answer: Paging is a memory-management scheme that permits the physical-address space of process to be noncontiguous. Paging avoids the considerable proble

What is a semaphore, What is a semaphore? A semaphore 'S' is a synchron...

What is a semaphore? A semaphore 'S' is a synchronization tool which is  an integer value that, apart from initialization, is accessed only by two standard atomic operations; w

Deadlock-avoidance algorithm, Regard as a computer system that runs 5000 jo...

Regard as a computer system that runs 5000 jobs per month with no deadlock-prevention or deadlock-avoidance scheme. Deadlocks take place about twice per month and the operator must

Explain disadvantages of the two-level directory, How do we overcome the di...

How do we overcome the disadvantages of the two-level directory? Give links from one user directory to another, creating path names; system files become available by letting th

What are overlays, What are overlays? To enable a process to be larger ...

What are overlays? To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructi

Illustrate the operating system components, Q. Illustrate the Operating Sys...

Q. Illustrate the Operating System Components? Modern operating systems share the goal of supporting system components. System components are: 1.  Process Management 2.

Explain external fragmentation?, Explain external fragmentation? Extern...

Explain external fragmentation? External fragmentation is the process where the free space and the space still available for use, in a piece of storage become separated into ma

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