Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write two versions (pipe version and shared memory version) of an interprocess communication program (A8p2_pipe.c, A8p2_shm.c or A8p2_pipe.cpp A8p2_shm.cpp) in C or C+t. Each version

image text in transcribed

write two versions (pipe version and shared memory version) of an interprocess communication program (A8p2_pipe.c, A8p2_shm.c or A8p2_pipe.cpp A8p2_shm.cpp) in C or C+t. Each version should create two processes using fork. One of them (the sender process) should send four intergers ab.cd in the range from 0 to 99 inclusive (that are interpreted as the coordinates of two points A,B in the plane A(ab) and BGd)) to the other (the receiver process). The sending process should printout the coordinates of the two points ACa.b) and B(cd). The receiving process should priutout the Manhattan distance between the two points A(ab) and B(Gd). Refer to https://en.wiktionary.org/wiki/Manhattan distance for the definition of Manhattan distance d(A,B) la-c+lb-dl. (30 points) Sample runs of the programs in 1 & 2 are shown below.| 'templ$ /A8p1 Hello am the child. Printing the Lower case version: hello an the parent. Printing the upper case version: HELLO child sent the coordinates of two points: A(9,44) and 8(67,87) parent process received the coordinates of two points: A(9,44) and 8(67,87) The Hanhattan distance between the two points is 58+43-101 parent sent the coordinates of two points: A(45,73) and 8(38,64) child received the coordinates of two points: A(45,73) and B(38,64) The Manhattan distance between the two points is 7+9-16 /templ$ /A8p2_shm templs ./A8p2 pipe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

Students also viewed these Databases questions