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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, ParallelUniverse
Which of the statements below is true? the formatting, standard, and drawing commands are unavailable. the formatting, standard, and drawing commands have been used. the formatting, standard, and drawing toolbars are displayed. the formatting, standard, and drawing toolbars are hidden.
Answers: 1
image
Computers and Technology, 22.06.2019 15:00, nika0001
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
image
Computers and Technology, 22.06.2019 18:00, Geo777
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, jack487
How can a user delete a drawing object
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 in other subjects:

Konu
Chemistry, 07.01.2020 01:31
Konu
Mathematics, 07.01.2020 01:31