46.1 ASYNCHRONOUS_PUBLISHER QosPolicy (DDS Extension)

This QosPolicy is used to enable or disable asynchronous publishing, asynchronous batch flushing, and TopicQuery publishing for the Publisher.

For each of these features enabled, the Publisher will spawn a thread. There is a thread for asynchronous publishing, a thread for asynchronous batch flushing, and a thread for TopicQuery publication.

The asynchronous publisher thread will be shared by all DataWriters (belonging to this Publisher) that have their 47.20 PUBLISH_MODE QosPolicy (DDS Extension) kind set to ASYNCHRONOUS. The asynchronous publishing thread will then handle the data transmission chores for those DataWriters. This thread will only be spawned when the first of these DataWriters is enabled.

The asynchronous publisher thread can be used to reduce the amount of time spent in the user thread to send data. You must use it when sending large data reliably. Large in this context means that the data size is larger than the transport’s message_size_max. See also 34.3 Large Data Fragmentation.

The asynchronous batch flushing thread will be shared by all DataWriters (belonging to this Publisher) that have batching enabled and max_flush_delay different than DURATION_INFINITE in 47.2 BATCH QosPolicy (DDS Extension). This thread will only be spawned when the first of these DataWriters is enabled.

The TopicQuery publication thread will be shared by all DataWriters (belonging to this Publisher) that have topic query dispatch enabled in 47.24 TOPIC_QUERY_DISPATCH_QosPolicy (DDS Extension). This thread will only be spawned when the first of these DataWriters is enabled.

This QosPolicy allows you to adjust the asynchronous publishing, the asynchronous batch flushing threads, and the TopicQuery publication threads independently.

Batching and asynchronous publication are independent of one another. Flushing a batch on an asynchronous DataWriter makes it available for sending to the DataWriter's 34.4 FlowControllers (DDS Extension). From the point of view of the FlowController, a batch is treated like one large DDS sample.

Connext will sometimes coalesce multiple DDS samples into a single network datagram. For example, DDS samples buffered by a FlowController or sent in response to a negative acknowledgement (NACK) may be coalesced. This behavior is distinct from DDS sample batching. DDS data samples sent by different asynchronous DataWriters belonging to the same Publisher to the same destination will not be coalesced into a single network packet. Instead, two separate network packets will be sent. Only DDS samples written by the same DataWriter and intended for the same destination will be coalesced.

This QosPolicy includes the members in Table 46.1 DDS_AsynchronousPublisherQosPolicy.

Table 46.1 DDS_AsynchronousPublisherQosPolicy

Type

Field Name

Description

DDS_Boolean

disable_asynchronous_write

Disables asynchronous publishing. To write asynchronously, this field must be FALSE (the default).

DDS_ThreadSettings_t

thread

Settings for the publishing thread. These settings are OS-dependent (see the RTI Connext Core Libraries Platform Notes). See also 50.4.7 Thread Settings.

Note: thread.cpu_list and thread.cpu_rotation are not relevant in this QoS policy.

DDS_Boolean

disable_asynchronous_batch

Disables asynchronous batch flushing. To flush asynchronously, this field must be FALSE (the default).

DDS_ThreadSettings_t

asynchronous_batch_thread

Settings for the asynchronous batch flushing thread. These settings are OS-dependent (see the RTI Connext Core Libraries Platform Notes). See also 50.4.7 Thread Settings.

Note: thread.cpu_list and thread.cpu_rotation are not relevant in this QoS policy.

DDS_Boolean

disable_topic_query_publication

Disables TopicQuery publication. To allow publishing TopicQueries responses, this field must be FALSE (the default).

DDS_ThreadSettings_t

topic_query_publication_thread

Settings for the TopicQuery publication thread. These settings are OS-dependent (see the RTI Connext Core Libraries Platform Notes). See also 50.4.7 Thread Settings.

Note: thread.cpu_list and thread.cpu_rotation are not relevant in this QoS policy.

46.1.1 Properties

This QosPolicy cannot be modified after the Publisher is created.

Since it is only for Publishers, there are no compatibility restrictions for how it is set on the publishing and subscribing sides.

46.1.2 Related PropertyQos Policies

  • dds.domain_participant.asynchronous_publisher_thread_destruction_timeout: Maximum time in seconds the DomainParticipant will wait for the destruction of an asynchronous publisher thread. If this timeout expires before the asynchronous publisher thread is destroyed, the DomainParticipant cannot safely release the thread's resources, and it will skip their release. Default: 10 (seconds). Valid values: 1-60 (seconds).

46.1.3 Related QosPolicies

  • If disable_asynchronous_write is TRUE (not the default), then any DataWriters created from this Publisher must have their 47.20 PUBLISH_MODE QosPolicy (DDS Extension) kind set to SYNCHRONOUS. (Otherwise create_datawriter() will return INCONSISTENT_QOS.)
  • If disable_asynchronous_batch is TRUE (not the default), then any DataWriters created from this Publisher must have max_flush_delay in 47.2 BATCH QosPolicy (DDS Extension) set to DURATION_INFINITE. (Otherwise create_datawriter() will return INCONSISTENT_QOS.)
  • DataWriters configured to use the 47.16 MULTI_CHANNEL QosPolicy (DDS Extension) do not support asynchronous publishing; an error is returned if a multi-channel DataWriter is configured for asynchronous publishing.
  • If disable_topic_query_publication is TRUE (not the default), then any DataWriters created from this Publisher must have enable in 47.24 TOPIC_QUERY_DISPATCH_QosPolicy (DDS Extension)) to TRUE. (Otherwise create_datawriter() will return INCONSISTENT_QOS.)

46.1.4 Applicable DDS Entities

Chapter 30 Publishers

46.1.5 System Resource Considerations

Three threads can potentially be created: