Establish shared-memory object between parent and child

Assignment Help Operating System
Reference no: EM13707307

Question: In previous, the child process must output the sequence of numbers generated from the algorithm specified by the Collatz conjecture because the parent and child have their own copies of the data.

Another approach to designing this program is to establish a shared-memory object between the parent and child processes.

This technique allows the child to write the contents of the sequence to the shared-memory object. The parent can then output the sequence when the child completes. Because the memory is shared, any changes the child makes will be reflected in the parent process as well. This program will be structured using POSIX shared memory. The parent process will progress through the following steps:

Part a: Establish the shared-memory object (shm open(), ftruncate(), and mmap()).

Part b: Create the child process and wait for it to terminate.

Part c: Output the contents of shared memory.

Part d: Remove the shared-memory object.

One area of concern with cooperating processes involves synchronization issues. In this exercise, the parent and child processes must be coordinated so that the parent does not output the sequence until the child finishes execution.

These two processes will be synchronized using the wait() system call: the parent process will invoke wait(), which will suspend it until the child process exits

You need to establish a shared-memory object between the parent and child processes. Provide the answer of given question and also give details.

Reference no: EM13707307

Questions Cloud

Write a c function called bspline : Write a C function called Bspline that takes as input a single double precision argument called x. The function returns a double precision value y determined as given
Implement the link list using java programming concepts : Modify the class LinkedList by adding to it the following methods. The appropriate error message should be generated if an invalid condition occurs.
Create a structure named dog with a string field : Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.
Prepare an overloaded constructor : Prepare an overloaded constructor that provides values for each field. Also provide get methods for each field. Save the file as Patient.java.
Establish shared-memory object between parent and child : the child process must output the sequence of numbers generated from the algorithm specified by the Collatz conjecture because the parent and child have their own copies of the data.
Write a program to implement a linear linked list : Write a C/C++ program to implement a singly linear Linked List
Function that will accept the three sides of a triangle : Create a function that will accept the three sides of a triangle (a, b, c) as scalar values, calculate the angles that correspond to these sides (alpha, beta, gamma), and return these angles to the function call in the script file.
Determine the total resistance of a number of resistors : Prepare a function that will determine the total resistance of a number of resistors that are connected in parallel.
Prepare a c program using the fork() system call : Perform required error checking to ensure that a positive integer is passed on the command line - Prepare a C program using the fork() system call that generates this sequence in the child process. The starting number will be provided from the comm..

Reviews

Write a Review

Operating System Questions & Answers

  Potential management plans for monitoring network activities

Discussion on potential management plans for monitoring network activities and maintaining security of the network.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  What is average rotational latency if seek time is given

5 Disk, seek time, latency, sector, request Single-platter disk rotation speed: 7200 rpm number of tracks on one side of platter. What is avg rotational latency?

  For each of these four modifications

For each of these four modifications, compute and graph the effects on the original system. Explain in words the effect when the multiprogramming level, N , is small and when N is large.

  Operating systems to be configured

company wants to upgrade the computers they have by adding another internal hard drive and preparing it for use. How do you explain how to do this and the options that the company has?

  Differences and similarities between the two operating syste

What are some distinct differences and similarities between the two operating systems? Why do you think it is important to know about both of these operating systems

  Given separate instruction and data cache units

Given separate instruction and data cache units, the MIPS ISA, an instruction cache miss rate of 15%, a data cache miss rate of 20%, and a miss penalty (for both cache units) of 5 clock cycles, what are the AMAT in cycles per access of the.

  Deadlock to occur in multiprogramming environment

List the reasons which causes deadlock to occur in multiprogramming environment and discuss how can the deadlock detection algorithm for one resource find out if a deadlock exists in the above sequence

  Computing the access time

Main memory uses a block transfer capability & has 1st word (four bytes) access time of fifty ns and access time for following words as 5 ns.

  Operating system proposal

Operating System Proposal

  Combining voice, video and data communications

Discuss the advantages and disadvantages to combining voice, video, and data communications into one interface such as Skype.

  Wireless encryption standards

Compare the several wireless encryption standards. Determine the purpose of implementing wireless encryption and discuss the benefits of each standard?

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