Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives 1 . To understand inter - process communication using message queues . Prelab 1 . Read the section that addresses message quenes in the
Objectives To understand inter process communication using message queues Prelab Read the section that addresses message quenes in the lab manal Read the muamual pages of the following systems calls : #include sys types.h #include sys ipe.b #include sys nag.h int magget key t key int megflg ; int megend int maqid const void nsgp sizet megsz int megfig ; saizet msgrev int maqid void sgp sizet magaz long nagtyp int nagfig ; struct Mensage long sype : char data Experiment Write two programs and name thim send.c and receive.e to send and receive messages from a message queue respectively The aand program is exerated as follows : and Ray type data it writes the text message data into the message queue whose key is key where type is the type of the written message The receive function on the other hand is executed as follows : A B receiva kay typa it reads a message of type type from the message queue whose ley is kay if such message exists and blocks otherwise Test your code and show your work to your lah instructor Use the following message format : E Assume you have two processes a parent and a child The parent prints the numbers from to while child priats the characters from A to E Use a single message queue to synchronize the two processes such they produce the following output : Une menage quees to synchronize three processes P P and P as follows where P is the parent of the other two ; a reads a string from the standard input and sends it to P b P converts the string to uppercase and send it to P e P prints the converted string to the output screen The three processes redo the above tasks forever until the user enters exit as an input string
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started