本文介绍了消息传递系统中的IPC-直接通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据《操作系统概念》一书,它说:

According to the book 'operating systems concepts', it says:

  • 发送(P,消息):发送消息以处理P
  • 接收(Q,消息)-从进程Q接收消息.

在不对称情况下,只有发件人为收件人命名;收件人不是 要求为发件人命名.在此方案中,发送和接收 原语定义如下:

In asymmetry only the sender names the recipient; the recipient is not required to name the sender. In this scheme, the send and receive primitives are defined as follows:

  • 发送(P,消息):发送消息以处理P.
  • receive(id,message):从任何进程接收消息;变量id设置为与之通信的进程的名称 已经发生了.
  • Send(P, message): Send a message to process P.
  • receive(id, message):Receive a message from any process; the variable id is set to the name of the process with which communication has taken place.

我不明白有什么区别?在非对称方案中,receive()调用是否不需要指定发件人ID?

I can't understand what is the difference? In asymmetric scheme, doesn't the receive() call need to specify the sender id?

推荐答案

区别在于receive()调用未指定发件人ID.这意味着发件人:收件人关系是多对一(N:1),而对称情况是1:1.许多实现提供了辅助机制来模糊这种影响.

That the receive() call does not specify the sender id is the difference. The implication is that the sender:receiver relationship is many to one (N:1), whereas the symmetric case is 1:1. Many implementations offer secondary mechanisms to blur this implications.

在N:1的情况下,需要对处理多个同时发送者的机制进行一些解释.解释涉及政策:先到先得;随机的;优先级,容量:#线程,以及调度参数和约束的继承.

In the N:1 case, there needs to be some explanation of the mechanisms for handling multiple simultaneous senders. Explanations involve policy:first come first served; random; priority, capacity: #-threads, and perhaps inheritance of scheduling parameters and constraints.

在1:1情况下,不需要策略或容量,可以安全地假设继承是先天的.因此,1:1案例更适合自动化分析.

In the 1:1 case, there is no need for policy or capacity, and it is safe to assume inheritance is innate. Thusly, the 1:1 case is more amenable to automated analysis.

允许动态配置sender:receiver对的1:1系统可能比这些已识别系统更加复杂.在这种系统中,发送者可以通过实例化该发送者的接收者的某个过程来发现接收者.在这种安排中,发现策略,容量,继承属性更加复杂.

A 1:1 system that permits dynamic configuration of sender:receiver pairs can be even more complex than these identified systems. In this sort of system, a sender may discover a receiver by some process which instantiates a receiver for this sender. Uncovering the policy,capacity,inheritance attributes is more complex in this sort of arrangement.

这篇关于消息传递系统中的IPC-直接通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 09:14