上海交通大学网络教育学院--计算机专业--操作系统作业---操作系统实验报告_进程与进程通信
12)
13)
14)
15)
16)
17)
18)
19) if(dRet == WAIT_OBJECT_0) { if(pMsgInfo->MsgNum != 0) //再次判断是否可读 { ori = MapViewOfFile(m_hFileMap, FILE_MAP_ALL_ACCESS,0,0,0); lpchar = (char *)ori; lpchar += sizeof(_MSGQ_HEADER)
sizeof(char)*msgSize[nowProcess]*pMsgInfo->ReadIndex;
20) strcpy((char *)buf,lpchar);
21) lpchar[0] = '\0';
22) pMsgInfo->MsgNum--;
23)
24)
25)
26)
27)
28)
29)
30)
31)
32)
33)
34)
35)
36)
37)
38) if(++pMsgInfo->ReadIndex == pMsgInfo->MsgMaxCount)//环形Queue pMsgInfo->ReadIndex = 0; bRet = TRUE; } ReleaseSemaphore(my_SemaphoreSend,1,NULL); }else if(dRet == WAIT_TIMEOUT) { QMessageBox::information(NULL,tr("提示"), tr("本进程邮箱已空,不可接收信息")); } UnmapViewOfFile(ori); CloseHandle(my_SemaphoreSend); CloseHandle(my_SemaphoreReceive); return bRet; } +
5.4.5、
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
11)
12)
13) 实时显示函数 int CMsgQ::Read(char **ReadMailBox) { LPCVOID ori; char *lpchar; int i; for(i=0 ;i<pMsgInfo->MsgMaxCount ;i++) ReadMailBox[i][0]='\0'; i=0; while(i != pMsgInfo->MsgMaxCount) { //ori = MapViewOfFile(m_hFileMap, FILE_MAP_READ,0,0,0); ori = m_hViewBuf; lpchar = (char *) ori;
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库操作系统实验报告_进程与进程通信(9)在线全文阅读。
相关推荐: