資源簡介
進程間通信設計
題目要求:消息的創建,發送和接收。
設計思路:使用系統調用msgget(),msgsnd(),msgrcv()及msgctl()編制一長度為1K的消息的發送和接收程序。
(站在巨人的肩膀上)
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#define?MSGKEY?75
struct?msgform
{
long?mtype;
char?mtexe[1024];
}msg;
int?msgqidi;
void?CLIENT(?)
{
int?i;
msgqid=msgget(MSGKEY0777);
for(i=10;i>=1;i--)
{
?msg.mtype=i;
?printf(“client?send?message:%d\n“i);
?
評論
共有 條評論