检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:王天伟
出 处:《计算机应用与软件》2017年第10期330-333,共4页Computer Applications and Software
摘 要:提出一种结合数据和资源管理的线程通信方法,从数据结构上对消息进行定义和描述,并在此基础上设计和实现具备消息供给/回收策略的消息工厂。每个消息的内部会维护一个栈式数据结构,用于存放需要传递给其他线程的数据;然后基于POSIX消息队列实现用于传递消息的邮箱。发送线程从消息工厂取出一条消息并通过对数据栈进行压栈操作将待发送数据提交给消息,然后将消息邮递到邮箱里,接收线程从邮箱中取出消息并将数据依次从消息的数据栈中弹出,并在数据处理完成后将消息返还给消息工厂。A multi-thread communication method based on data and resource management is proposed. The concept of message is defined by a data structure,on the basis of which a message factory with supply/recycling strategy is designed and realized. First,each message maintained a stack of data structure,which was used to store the data that need to be passed to other threads. Afterwards,the mailbox based on POSIX message queue was implemented for passing messages.The sending thread took a message from the message factory and the data was submitted to the message by pushing onto a data stack. Then the message would be sent to a mailbox. The receiving thread fetched a message from the mailbox and popped the data sequentially from the message stack. At last the message would be returned to the message factory after the data had been processed.
分 类 号:TP3[自动化与计算机技术—计算机科学与技术]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.133.158.178