Question: Objectives 1 . To understand inter - process communication using message queues . Prelab 1 . Read the section that addresses message quenes in the

Objectives 1. To understand inter - process communication using message queues . Prelab 1. Read the section that addresses message quenes in the lab manal .2. 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 , size_t megsz , int megfig ) ; saize_t msgrev ( int maqid , void sgp , size_t magaz , long nagtyp , int nagfig ) ; struct Mensage long sype : char data [15]} Experiment 1. 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 : 1 A 2 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 : 5 E 2. Assume you have two processes , a parent and a child . The parent prints the numbers from 1 to 6, 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 : 3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!