Skip to content

C Media Driver Operation

Martin Thompson edited this page May 3, 2022 · 8 revisions

This section assumes familiarity with Aeron Terminology and Media Driver Operation.

The C media driver behaves almost exactly how the Java media driver operates. The threading models are the same, except where noted here. The architecture is directly analogous.

Threading Model

A typical media driver has 3 threads, i.e. the conductor, sender, and receiver threads. Alternatively, a shared thread is run from the main process thread.

Configuration

All configuration for the C media driver can be done via environment variables. The variables are directly related to the Java properties for the Java media driver. The environment variables simply have '_' in the place of ".". For example, setting the environment variable AERON_TERM_BUFFER_LENGTH is equivalent to setting aeron.term.buffer.length in the Java media driver.

Alternatively, the properties files can be used like the Java driver. File names passed as command line arguments with the option of fetching the files over HTTP.

For convenience the JVM system properties format is supported using the -D prefix as follows:

$ aeronmd -Daeron.print.configuration=true

This will print the configuration used on start to stdout.

Operation

The driver can be started simply by executing aeronmd.

$ aeronmd

The driver can be stopped gracefully via Ctrl-c or SIGINT just like the Java media driver.

Embedding the Driver

The C media driver may be embedded quite easily. An example is the driver main itself, aeronmd.c, and the API is documented in aeronmd.h.