How do I create multiple participants within a single process with RTI Connext Micro?

Note: Applies to RTI Connext Micro 3.x and above

By default, you can create 1 DomainParticipant within a single process with RTI Connext Micro because the default max_participants resource limit is set to 1. Note that you cannot create more than 16 participants within a single process with Micro due to an internal limit on the number of RTPS interfaces. 

In order to increase the maximum number of participants that can be created within a single process, there are several resource limits you need to change:

  1. DomainParticipantFactoryQos.resource_limits.max_participants must be increased to match the number of participants you intend to create within a single process. The default for this resource limit is 1, and the maximum is 16.

  2. Each participant in Micro needs 1 timer. You should set OSAPISYSTEM_MAX_TIMERS, as defined in src/osapi/posix/posixSystem.c, equal to DomainParticipantFactoryQos.resource_limits.max_participants

  3. The maximum number of semaphores that Micro can create, OSAPI_SYSTEM_MAX_THREAD_SEMAPHORE, must be set according to the following formula:

    (11 + ( DomainParticipantFactoryQos.resource_limits.max_participants - 1)*3)

    You should set OSAPI_SYSTEM_MAX_THREAD_SEMAPHORE when compiling the Micro libraries. You can set it at compilation time with the following:

    -DOSAPI_SYSTEM_MAX_THREAD_SEMAPHORE=<value>