Answered step by step
Verified Expert Solution
Link Copied!

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 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

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

Identify the major criticisms of neurofinance research.

Answered: 1 week ago

Question

Analyze the impact of labor unions on health care.

Answered: 1 week ago

Question

Assess three motivational theories as they apply to health care.

Answered: 1 week ago

Question

Discuss the history of U.S. labor unions.

Answered: 1 week ago