Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Write a program that creates a hierarchy of processes using the fork() system call. The initial program termed the root, along with all its o springs will ultimately form a full binary tree. The tree has both internal and leaf-level nodes.

The basic objective of the tree is to help sort the content of a (potentially very large) data le consisting of taxpayer records. This is done in a \divide-and-conquer" style: the leaf-level nodes are responsible for sorting portions of the data le, while the internal nodes help merge partially ordered data and present their combined outcome to their parent and ultimately to the root.

The leaf level nodes use diverse independent programs to sort the portion of the input data le they are assigned to. The required data communication between consecutive levels of processes takes place with the help of named-pipes (FIFOs).

In the context of this project, you will:

Create a hierarchy of processes using fork(),  allow the execution of various executables (or di erent pieces of code) by the nodes of the hierarchy, use a number of useful system calls including fork(), exec*(), read(), write(), mk fo(), wait(), poll(), etc.

The Process Hierarchy:

Figure 1 depicts a sample process hierarchy your program may generate. The overall goal of the hierarchy is to create a sorted listing of all data records based on a user-provided condition; records are provided to the root in the form of a data le (binary/text). There are three types of nodes that try to accomplish di erent types of tasks. In particular:

1. root node: this is your program and functions as the \anchor" for the entire hierarchy; more importantly, it orchestrates of the entire sorting operation.

1367_Hierarchy of processes using the fork system.png

At rst, it creates a single splitter/merger node and the root passes to this node {named sm0{ the range of records whose sorting is to oversee (i.e., the entire range). The depth of the tree (and consequently the number of levels internal nodes can be found) is designated by a parameter at the command line of your program (root).

2. sort nodes: each of these leaf-level nodes is provided with a set of records (possibly in the form of a le name/descriptor, as well as the range of the records in the le) that it will have to sort. To achieve their goal, sorters deploy di erent programs and return to their parent their outcome in the form of a named-pipe (FIFO queue).

Four di erent programs are used to do sorting at leaf-level, namely:

(a) Shell-Sort (SH): you have to write this independent program

(b) Quick-Sort (QS): you have to write this independent program

(c) sort (SO): the Unix system program

(d) Buble-Sort (BS): you have to write this independent program

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9131972

Have any Question?


Related Questions in Programming Language

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As