RTI Connext Modern C++ API  Version 5.3.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::pub::FlowControllerSchedulingPolicy_def Struct Reference

<<extension>> Kinds of flow controller shceduling policy More...

#include <FlowController.hpp>

Public Types

enum  type {
  ROUND_ROBIN,
  EARLIEST_DEADLINE_FIRST,
  HIGHEST_PRIORITY_FIRST
}
 The underlying enum type. More...
 

Detailed Description

<<extension>> Kinds of flow controller shceduling policy

Samples written by an asynchronous dds::pub::DataWriter are not sent in the context of the dds::pub::DataWriter::write() call. Instead, the middleware puts the samples in a queue for future processing. The rti::pub::FlowController associated with each asynchronous DataWriter instance determines when the samples are actually sent.

Each rti::pub::FlowController maintains a separate FIFO queue for each unique destination (remote application). Samples written by asynchronous dds::pub::DataWriter instances associated with the flow controller, are placed in the queues that correspond to the intended destinations of the sample.

When tokens become available, a flow controller must decide which queue(s) to grant tokens first. This is determined by the flow controller's scheduling policy. Once a queue has been granted tokens, it is serviced by the asynchronous publishing thread. The queued up samples will be coalesced and sent to the corresponding destination. The number of samples sent depends on the data size and the number of tokens granted.

QoS:
rti::pub::FlowControllerProperty
See Also
rti::pub::FlowControllerSchedulingPolicy The safe enumeration for this type

Member Enumeration Documentation

The underlying enum type.

Enumerator:
ROUND_ROBIN 

Indicates to flow control in a round-robin fashion.

Whenever tokens become available, the flow controller distributes the tokens uniformly across all of its (non-empty) destination queues. No destinations are prioritized. Instead, all destinations are treated equally and are serviced in a round-robin fashion.

EARLIEST_DEADLINE_FIRST 

Indicates to flow control in an earliest-deadline-first fashion.

A sample's deadline is determined by the time it was written plus the latency budget of the DataWriter at the time of the write call (as specified in the dds::core::policy::LatencyBudget). The relative priority of a flow controller's destination queue is determined by the earliest deadline across all samples it contains.

When tokens become available, the rti::pub::FlowController distributes tokens to the destination queues in order of their deadline priority. In other words, the queue containing the sample with the earliest deadline is serviced first. The number of tokens granted equals the number of tokens required to send the first sample in the queue. Note that the priority of a queue may change as samples are sent (i.e. removed from the queue). If a sample must be sent to multiple destinations or two samples have an equal deadline value, the corresponding destination queues are serviced in a round-robin fashion.

Hence, under the default dds::core::policy::LatencyBudget::duration setting, an EDF_FLOW_CONTROLLER_SCHED_POLICY rti::pub::FlowController preserves the order in which the user calls dds::pub::DataWriter::write() across the DataWriters associated with the flow controller.

Since the dds::core::policy::LatencyBudget is mutable, a sample written second may contain an earlier deadline than the sample written first if the dds::core::policy::LatencyBudget::duration value is sufficiently decreased in between writing the two samples. In that case, if the first sample is not yet written (still in queue waiting for its turn), it inherits the priority corresponding to the (earlier) deadline from the second sample.

In other words, the priority of a destination queue is always determined by the earliest deadline among all samples contained in the queue. This priority inheritance approach is required in order to both honor the updated dds::core::policy::LatencyBudget::duration and adhere to the dds::pub::DataWriter in-order data delivery guarantee.

[default] for dds::pub::DataWriter

HIGHEST_PRIORITY_FIRST 

Indicates to flow control in a highest-priority-first fashion.

Determines the next destination queue to service as determined by the publication priority of the dds::pub::DataWriter, channel of multi-channel DataWriter, or individual sample.

The relative priority of a flow controller's destination queue is determined by the highest publication priority of all samples it contains.

When tokens become available, the rti::pub::FlowController distributes tokens to the destination queues in order of their publication priority. In other words, the queue containing the sample with the highest publication priority is serviced first. The number of tokens granted equals the number of tokens required to send the first sample in the queue. Note that the priority of a queue may change as samples are sent (i.e. removed from the queue). If a sample must be sent to multiple destinations or two samples have an equal publication priority, the corresponding destination queues are serviced in a round-robin fashion.

This priority inheritance approach is required in order to both honor the designated publication priority and adhere to the dds::pub::DataWriter in-order data delivery guarantee.


RTI Connext Modern C++ API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc