subject

Follow the example programs unix_pipe. c, named_pipe. c and shm-posix-combined. c to write three versions (two pipe versions and one shared memory version) of an interprocess communication program (A8p2_unixpipe. c(pp), A8p2_namedpipe. c(pp) and A8p2_shm. c(pp)) in C or C++. Each version should create two processes using fork. One of the two processes should send or share four random intergers a, b,c, d in the range from 0 to 99 inclusive (that are interpreted as the coordinates of two points A, B in the plane A(a, b) and B(c, d)) to the other process. The sending process should print out the coordinates of the two points A(a, b) and B(c, d). The receiving process should print out the Manhattan distance between the two points A(a, b) and B(c, d). Refer to https://en. wiktionary. org/wiki/Manhattan_distance for the definition of Manhattan distance d(A, B)=|a-c|+|b-d|. Sample runs of the programs in 1 & 2. You do not need to submit screen shots. Instead submit source code files. I am the child. Printing the lower case version: hello I am the parent. Printing the reversed upper case version: OLLEH 9rmp/toorn- ob-01.b0.erjbrp]$ A8p2_unixpipe parent sent the coordinates of two pointsA(57,61) and B(54,34) child received the coordinates of two points: A(57,61) and B(54,34) The Manhattan distance between the two points is 3+27-30 9kEe,93itSe 1.local] [~/work/temp]$ A8p2_namedpipe parent sent the coordinates of two points: A(39,94) and B(51,13) child received the coordinates of two points: A(39,94) and B(51,13) The Maabpttao distance between the two points is 12+81-93 child wrote the coordinates of two points: A(24,50) and B(34,66) parent process read the coordinates of two points: A (24,50) and B(34,66) The Manhattan distance between the two points is 10+16-26.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
This graph compares the cost of room and board at educational institutions in texas.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
You know the right answer?
Follow the example programs unix_pipe. c, named_pipe. c and shm-posix-combined. c to write three ver...
Questions
question
Computers and Technology, 01.07.2019 07:30
question
Mathematics, 01.07.2019 07:30
Questions on the website: 13722361