- 1、本文档共28页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
msgque(国外英语资料)
msgque(国外英语资料)
In UNIX, a process makes another entity perform a transaction, and the action taken is a sub process of fork. The child process copies only the data area of the parent process to its own data area. In accordance with the POSIX standard UNIX operating system, the same process threads to share process instructions, most of the data (except for thread private data), signal processing methods, processes, operating environment. Because the thread shares the global variables of the process, it can share the data with the message queue written by the user himself.
Build a multitasking model and implement it with threads
The UNIX operating system that meets the POSIX standard provides control functions for threads, such as creation and termination of threads, mutex between threads, synchronization among threads, and so on. Using these system functions, the message queue can be successfully simulated to realize data sharing and synchronization among threads, so as to accomplish the real-time performance of multi tasks. To successfully describe data sharing and synchronization between threads, take the following task model as an example.
First, the message queue property data structure is established
#define MAXQUEUE 30
Typedef, struct, mq_attrib {
Char name[20];
Pthread_mutex_t mutex_buff;
Pthread_mutex_t mutex_cond;
Pthread cond_t cond;
Int maxElements;
Int elementLength;
Int curElementNum;
Caddr_t buff;
}mq_attrib, mq_attribstruct, mq_attrib_t apparatus;
Mq_attrib_t msqueue[MAXQUEUE];
The data structure defines the message queue name name, maximum message number maxElements, a single message length is elementLength, the current message number curElementNum, stored message buffer buff, buffer protection lock mutex_buff, thread synchronization variables cond, mutex_cond variable thread synchronization lock protection.
Creation of a message queue
Create a message queue based on this data structure. The function is msqueue_create (parameter interpretation: name,
您可能关注的文档
- CAD常用命令符(国外英语资料).doc
- CAD常用快捷命令(国外英语资料).doc
- cad常用快捷键命令(国外英语资料).doc
- cad常用指令(国外英语资料).doc
- CAD基编辑命令(国外英语资料).doc
- CAD快捷命名(国外英语资料).doc
- CAD快捷绘图命令(国外英语资料).doc
- CAD快捷键(自我总结的常用)(国外英语资料).doc
- cad快捷键使用(国外英语资料).doc
- CAD与3dmax快捷键大全(国外英语资料).doc
- 2025至2030车身传感器行业发展趋势分析与未来投资战略咨询研究报告.docx
- 2025至2030肠胃外药物行业项目调研及市场前景预测评估报告.docx
- 2025至2030灯具行业市场深度调研及供需格局及有效策略与实施路径评估报告.docx
- 2025至2030底部安装压力表行业发展趋势分析与未来投资战略咨询研究报告.docx
- 2025至2030第三代测序行业发展趋势分析与未来投资战略咨询研究报告.docx
- 2025至2030电饼铛行业项目调研及市场前景预测评估报告.docx
- 2025至2030赌桌行业发展趋势分析与未来投资战略咨询研究报告.docx
- 2025至2030靶向药物输送系统行业产业运行态势及投资规划深度研究报告.docx
- 2025至2030阿米卡星(CAS37517285)行业发展趋势分析与未来投资战略咨询研究报告.docx
- 2025至2030财务管理软件行业产业运行态势及投资规划深度研究报告.docx
最近下载
- 泸州老窖“浓香文酿杯”企业文化知识竞赛考试题库大全-中(判断题汇总).docx VIP
- 2025北京经济技术开发区招考社区工作者80人笔试参考题库附答案解析.docx VIP
- 规范管理食堂真心服务学生 学校食堂管理工作典型经验案例.docx VIP
- 安徽省第四届全省家政服务职业技能大赛婴幼儿发展引导员考试题库(含答案) .docx VIP
- 概率论基础教程答案英文ch09.pdf VIP
- 风电场前期开发流程.ppt VIP
- 2016年恩施州中考数学真题(含答案).docx VIP
- 2025北京经济技术开发区招考社区工作者80人考试备考试题及答案解析.docx VIP
- 营销总监劳动合同.docx VIP
- 三菱变频器FR-E820 FR-E840 FR-E860接线说明书.pdf VIP
文档评论(0)