I have a simple C++ application that attempts to allocate (up to) 24 domain participants and then just deletes them after a short pause. I can never get past 9. The code looks like this:
int domainId = 0;
vector<DDS::Participant*> partList(24);
DDS::DomainParticipantFactory* factory;
DDS::DomainParticipant* participant;
factory = DDS::DomainParticipantFactory::get_instance();
if (factory == 0) {
cout << "?Cannot get participant factory" << endl;
exit(1);
}
for( ; (domainId < 24); ++domainId) {
cout << "- creating participant on domain(" << domainId << ")" << endl;
participant = factory->create_participant(
domainId,
DDS_PARTICIPANT_QOS_DEFAULT,
NULL,
DDS_STATUS_MASK_NONE);
if (participant == 0) {
cout << "?Cannot create participant on domain(" << domainId << ")" << endl;
break;
}
partList[domainId] = participant;
}
// etc It always results in this at domainId(9):
- creating participant on domain(9)
[CREATE Participant]PRESPsService_new:!create worker-specific object
[CREATE Participant]DDS_DomainParticipantService_initialize:!create publish/subscribe service (participant_index collision?)
[CREATE Participant]DDS_DomainParticipant_createI:!initialize publish/subscribe service
[CREATE Participant]DDS_DomainParticipantDatabase_prefinalize:!database shutdown timeout
[CREATE Participant]RTIEventActiveDatabase_delete:!precondition
[CREATE Participant]DDS_DomainParticipantDatabase_finalize:!delete database
[CREATE Participant]RTIOsapiSemaphore_delete:!delete mutex
[CREATE Participant]REDAWorkerFactory_destroyExclusiveArea:!precondition: m == ((void *)0) || (ea != ((void *)0) && (ea->_enteredCount > 0 || ea->_refCount != 0))
[CREATE Participant]REDAWorkerFactory_destroyExclusiveArea:!precondition: m == ((void *)0) || (ea != ((void *)0) && (ea->_enteredCount > 0 || ea->_refCount != 0))
[CREATE Participant]REDAWorkerFactory_destroyExclusiveArea:!precondition: m == ((void *)0) || (ea != ((void *)0) && (ea->_enteredCount > 0 || ea->_refCount != 0))
[CREATE Participant]DDS_DomainParticipantFactory_create_participant_disabledI:!create participant
DDSDomainParticipant_impl::create_disabledI:!create participant
DDSDomainParticipant_impl::createI:!create participant
DomainParticipantFactory_impl::create_participant():!create failure creating participant
?Cannot create participant on domain(9)
I also have saved the same thing using verbose (NDDSConfigLogger->set_verbosity_by_category()) output on ENTITIES and API. I can provide that and/or the full source of the test app if you'd like.
Thanks,
Frank
Hello Frank,
You are running out of worker-specific objects. You can create additional DomainParticipants by changing the QoS to allow more worker-specific objects.
Here is a Solution that describes how to change that QoS: http://community.rti.com/kb/how-many-domain-participants-can-be-created-single-address-space
Thank you!
Rose