Asynchronous Writer

In DDS the term  Asynchronus Write is used to indicate that the process of writing a Data using a DDS DataWriter is independent from the process of sending that data on the network.  To accomplish this, Connext DDS uses a separate operating system Thread owned by the Publisher to send the data on the network.

By default when the application writes data using a DataWriter, the write operation is synchronous, that is, the same application Thread that calls the write operation is used to perform all the necessary tasks: data seralization, construction of the nework (RTPS) message, encryption (if appropriate) and dispatch to the underlying transport(s) (e.g. UDP sockets, shared memory, etc.).  This so-called synchronous write avoids a thread context swich and therefore uses less resources and has lower latency than an asynchronous write. However it delays the return of the write operation to the application. 

Applications can cofigure a DataWriter to write data asynchrnously using  the PUBLISH_MODE Qos Policy.  When enabled, the application thread is only used to copy (serialize) the data into the DataWriter cache, the remaning operations are done by a separate thread managed by the Publisher. The configuration of this Publisher thread can also be controlled via Qos. To do this use the ASYNCHRONOUS_PUBLISHER Qos Policy on the Publisher.

Asynchrous writing is especially important when sending large data packets that require fragmentation into multiple network messages. It is also needed if the application want to use a Flow Controller to regulate the rate at which the DataWriter sends data to the network.