DDS QoS - TRANSPORT_PRIORITY

https://download.csdn.net/download/eidolon_foot/12568768

15. TRANSPORT_PRIORITY

OpenDDS Developer's Guide(OpenDDS Version 3.14)
The TRANSPORT_PRIORITY policy applies to topic and data writer entities via the transport_priority member of their respective QoS policy structures. Below is the IDL related to the TransportPriority QoS policy:
TRANSPORT_PRIORITY策略通过其各自的QoS策略结构的transport_priority成员应用于主题和数据写入者实体。 以下是与TransportPriority QoS策略相关的IDL:
struct TransportPriorityQosPolicy {
long value;
};
The default value member of transport_priority is zero. This policy is considered a hint to the transport layer to indicate at what priority to send messages. Higher values indicate higher priority. OpenDDS maps the priority value directly onto thread and DiffServ codepoint values. A default priority of zero will not modify either threads or codepoints in messages.
transport_priority的默认值成员为零。 该策略被认为是对传输层的提示,用于指示以什么优先级发送消息。 较高的值表示较高的优先级。 OpenDDS将优先级值直接映射到线程和DiffServ代码点值。 默认优先级为零将不会修改消息中的线程或代码点。
OpenDDS will attempt to set the thread priority of the sending transport as well as any associated receiving transport. Transport priority values are mapped from zero (default) through the maximum thread priority linearly without scaling. If the lowest thread priority is different from zero, then it is mapped to the transport priority value of zero. Where priority values on a system are inverted (higher numeric values are lower priority), OpenDDS maps these to an increasing priority value starting at zero. Priority values lower than the minimum (lowest) thread priority on a system are mapped to that lowest priority. Priority values greater than the maximum (highest) thread priority on a system are mapped to that highest priority. On most systems, thread priorities can only be set when the process scheduler has been set to allow these operations. Setting the process scheduler is generally a privileged operation and will require system privileges to perform. On POSIX based systems, the system calls of sched_get_priority_min() and sched_get_priority_max() are used to determine the system range of thread priorities.
OpenDDS将尝试设置发送传输以及任何关联的接收传输的线程优先级。传输优先级值从零(默认值)到最大线程优先级线性映射而不进行缩放。如果最低线程优先级不同于零,那么它将映射到传输优先级值零。如果系统上的优先级值是相反的(较高的数字值表示较低的优先级),则OpenDDS会将其映射到从零开始的递增优先级值。低于系统上最小(最低)线程优先级的优先级值将映射到该最低优先级。大于系统上最大(最高)线程优先级的优先级值将映射到该最高优先级。在大多数系统上,只有在将进程调度程序设置为允许这些操作时才能设置线程优先级。设置进程调度程序通常是一项特权操作,并且需要系统特权才能执行。在基于POSIX的系统上,系统调用sched_get_priority_min()和sched_get_priority_max()用于确定线程优先级的系统范围。
OpenDDS will attempt to set the DiffServ codepoint on the socket used to send data for the data writer if it is supported by the transport implementation. If the network hardware honors the codepoint values, higher codepoint values will result in better (faster) transport for higher priority samples. The default value of zero will be mapped to the (default) codepoint of zero. Priority values from 1 through 63 are then mapped to the corresponding codepoint values, and higher priority values are mapped to the highest codepoint value (63).
如果传输实现支持,OpenDDS将尝试在套接字上设置DiffServ代码点,该代码点用于为数据写入器发送数据。 如果网络硬件接受代码点值,则更高的代码点值将导致更高优先级样本的更好(更快)传输。 默认值零将映射到零的(默认)代码点。 然后将从1到63的优先级值映射到相应的代码点值,并将更高的优先级值映射到最高代码点值(63)。
OpenDDS does not currently support modifications of the transport_priority policy values after creation of the data writer. This can be worked around by creating new data writers as different priority values are required.
创建数据写入器后,OpenDDS当前不支持对transport_priority策略值的修改。 可以通过创建新的数据写入器来解决此问题,因为需要不同的优先级值。
Data Distribution Service Version 1.4( formal/2015-04-10)
The purpose of this QoS is to allow the application to take advantage of transports capable of sending messages with different priorities.
此QoS的目的是允许应用程序利用能够发送具有不同优先级的消息的传输机制。
This policy is considered a hint. The policy depends on the ability of the underlying transports to set a priority on the messages they send. Any value within the range of a 32-bit signed integer may be chosen; higher values indicate higher priority.
该政策被认为是提示。 该策略取决于基础传输对它们发送的消息设置优先级的能力。 可以选择32位有符号整数范围内的任何值。 较高的值表示较高的优先级。
However, any further interpretation of this policy is specific to a particular transport and a particular implementation of the Service. For example, a particular transport is permitted to treat a range of priority values as equivalent to one another. It is expected that during transport configuration the application would provide a mapping between the values of the TRANSPORT_PRIORITY set on DataWriter and the values meaningful to each transport. This mapping would then be used by the infrastructure when propagating the data written by the DataWriter .
但是,对此政策的任何进一步解释都特定于服务的特定运输和特定实施。 例如,允许一种特定的传输将一系列优先级值视为等同。 预期在传输配置期间,应用程序将提供DataWriter上设置的TRANSPORT_PRIORITY的值与对每个传输有意义的值之间的映射。 然后,在传播由DataWriter写入的数据时,基础结构将使用此映射。

用ChatGPT

《OpenDDS Developer's Guide》:

这段文本主要在描述《OpenDDS Developer's Guide》中的`TRANSPORT_PRIORITY`策略。以下是对应的中文翻译及讲解:
3.2.14 传输优先级
TRANSPORT_PRIORITY策略通过他们各自的QoS策略结构中的`transport_priority`成员,适用于主题和数据写入者实体。以下是与传输优先级QoS策略相关的IDL(接口定义语言)结构:

struct TransportPriorityQosPolicy {
   long value;
};

transport_priority的默认值成员为零。此策略被认为是向传输层提供的一个提示,用以指示消息发送的优先级。数值越高表示优先级越高。OpenDDS会将优先级值直接映射到线程和DiffServ代码点值上。默认优先级为零,不会修改消息中的线程或代码点。
OpenDDS将尝试设置发送传输的线程优先级,以及任何关联的接收传输。传输优先级值从零(默认)映射到最大线程优先级,线性映射而不进行缩放。如果最低线程优先级与零不同,则将其映射到传输优先级值为零。在系统上的优先级值是倒置的(更高的数字值是较低的优先级),OpenDDS将这些映射为从零开始的递增优先级值。在系统上低于最小(最低)线程优先级的优先级值将映射到该最低优先级。高于最大(最高)线程优先级的优先级值将映射到该最高优先级。在大多数系统上,只有当进程调度程序被设置为允许这些操作时,才能设置线程优先级。设置进程调度程序通常是一个特权操作,需要系统权限才能执行。在基于POSIX的系统上,使用系统调用`sched_get_priority_min()`和`sched_get_priority_max()`来确定系统的线程优先级范围。
如果传输实现支持的话,OpenDDS也将尝试设置用于发送数据写入者数据的套接字上的DiffServ代码点。如果网络硬件遵循代码点值,更高的代码点值将导致更优先级高的样本获得更好(更快)的传输。默认值为零的将映射到(默认)代码点值为零。然后,从1到63的优先级值将映射到相应的代码点值,更高的优先级值将映射到最高代码点值(63)。
目前,OpenDDS不支持在数据写入者创建后修改`transport_priority`策略值。可以通过根据所需的不同优先级值创建新的数据写入者来解决这个问题。
在这段描述中,`TRANSPORT_PRIORITY`策略作为一个配置参数,指示了数据在网络上传输时的优先级,其使用了用来设置线程优先级以及DiffServ(区分服务)代码点的机制,通过修改线程优先级和网络层的QoS设置来影响数据包的传输优先级。需要注意的是,OpenDDS提供了设置启动时优先级的功能,但不支持在数据写入者创建之后更改这个优先级值。如果需要动态改变优先级则需要创建新的数据写入者。

《Data Distribution Service (DDS)》Version 1.4 :

这段文字来自《数据分发服务(DDS)》版本1.4的正式文件编号:formal/2015-04-10,下面是它的中文翻译和解释:
2.2.3.15 传输优先级(TRANSPORT_PRIORITY)
这一服务质量(QoS)的目的是允许应用程序利用能够以不同优先级发送消息的传输手段。
这项政策被视为一个提示。该策略取决于底层传输能否在它们发送的消息上设置优先级。可以选择任何一个32位有符号整数范围内的值;更高的值表示更高的优先级。然而,对这一政策的任何进一步解释都具体依赖于特定的传输方式及特定的服务实现。例如,一个特定的传输方式被允许将一系列优先级值视为等同。预计在传输配置期间,应用程序会提供在DataWriter上设置的TRANSPORT_PRIORITY的值与每个传输方式有意义的值之间的映射。然后,这个映射将由基础设施使用,当传播DataWriter写入的数据时。
讲解:
在DDS中,服务质量(Quality of Service,QoS)策略为数据交互提供了详尽的控制方式。TRANSPORT_PRIORITY QoS策略让你可以为发送的消息设定优先级,从而指导传输层如何处理这些消息的传输顺序。这个优先级设置被视为一个提示而不是强制要求,它并不保证消息一定会按照优先级顺序进行传输,因为实际的效果取决于传输层是否支持以及如何实现这个特性。
你可以为消息指定任何一个32位整数作为优先级值,更高的数值代表更高的优先级。但是,不同的传输机制可能会有不同的解释方式,它们可能会将某些优先级值视为等同,或者根据内部的优先级队列来处理这些值。
在进行系统配置时,应用程序应当指定如何将DDS中的TRANSPORT_PRIORITY值映射到具体传输机制识别的优先级值上。这使得你可以根据具体的传输手段来调整数据的优先级策略,为消息在各种网络条件下的传播提供灵活的控制。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

109702008

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值