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 02:00, sabrinarasull1pe6s61
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, manyah6189
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
image
Computers and Technology, 22.06.2019 22:40, Bgreene2377
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, osirisarellane3792
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
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
Social Studies, 16.10.2020 14:01