assignment, Operating System

You must use fork and pipe to complete this project.

This project creates processes to add all numbers in a file. The user will enter a number (1, 2, or 4) of parallel processes to create for processing the numbers. The system will then create this many processes, evenly dividing the file contents between the processes. For example, if the file has 1000 numbers and the user wants 4 processes, then each process would process 250 numbers in the file.

III. System Description

The system is illustrated in the diagram shown below. The processes are as follows:
1. Parent process. This process allows user to input the number of processes to create (1, 2, or 4). It determines what portion of the file each process must work on and informs the process via a pipe. It then waits for each child to report its result. Once each result is received, it combines the results prints the overall result.
2. Child process. Receive which part of the file to process. Process the file and send results back to the parent process.
Posted Date: 10/1/2012 8:24:08 PM | Location : United States







Related Discussions:- assignment, Assignment Help, Ask Question on assignment, Get Answer, Expert's Help, assignment Discussions

Write discussion on assignment
Your posts are moderated
Related Questions
What is the use of inter process communication. Inter process communication gives a mechanism to allow the co-operating process to communicate with each other and synchronies t

Q. Explain some of the ways an application can use memory via the Win32 API. Answer: (1) Virtual memory offers several functions that allow an application to reserve and rele

what if we need the portion from a text based on some keyword. For eg. My file is like below, ------------------------------------------------ Order=[ 1 2 3 4 5 Order=[ 6 7 8 9

How are file sharing and protection implemented? To execute file sharing and protection the system have to maintain more file and directory attributes than are needed on a sing

Question 1: a) State the different file attributes and briefly explain the operations that can be performed on each files. b) What is a semaphore? Describe why it is impor


What are the different file operations? Create : - Space for the file in the file system update directory table. Write : - file name and data to be written is

What do you mean by system calls? System calls give the interface among a process and the operating system. When a system call is implemented, it is treated as by the hardware

Write a short note on PCB? Every process is represented in the operating system by a process control block also called a task control block. It contains more information regard

The idea of reference counting is to maintain, for every object, the total number of references to that object, i.e. the number of "incoming" pointers. Whenever the number of refer