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?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
The ieee 802.11: defines standards for wireless local area network (wlan) communication protocols. identifies various computers or devices connected to a network. verifies any resource attached to another computer on a network that is different from the computer to which the user is logged on. connects multiple local area networks (lans) and wide area networks (wans).
Answers: 2
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
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
Mathematics, 13.03.2020 19:14
Questions on the website: 13722363