CECS 326 – Lab Exercise 9/22/05 (20 points) – Due 9/29/05 Cooperating processes often need to communicate between them. One mechanism Linux provides for interprocess communication is message queues. A message queue must first be aquired from the operating system by calling msgget. Control operations, e.g., remove, can be performed on an existing message queue by calling msgctl. Processes with appropriate permissions may send and/or receive messages via the message queue by calling msgsnd and msgrcv. A very useful function named ftok() can be used to convert a file name into a key for msgget call. Please consult the man pages of these system calls for details.For this exercise you need to write three C++ programs named master.cpp, sender.cpp, and receiver.cpp, which should be compiled into master, sender, and receiver, respectively. Together they should do the following:•The masterprogram should first acquire a message queue from the operating system, followed by creating two
This is the end of the preview.
access the rest of the document.