how to change max_objects_per_thread in rticonnextdds_connector

2 posts / 0 new
Last post
Offline
Joined: 06/17/2017
Posts: 1
how to change max_objects_per_thread in rticonnextdds_connector

Hi,

 We are experimenting with the rticonnextdds_connector with node.js. Due to some legacy reason, we need more than 10 participants from different domains. However, node.js has a single process. On our 64-bit Ubuntu 14.04, the maximum number of participants was limited to 8.

   In order to increase the number of participants, we would have to change the resource_limits.max_objects_per_thread of DDS_DomainParticipantFactoryQos. The api to access DDSDomainParticipantFactory is not exposed in the connector.

  Is is possible to use c++ addon to access the DDSDomainParticipantFactory and change the resource limits?

  The following was one such atempt:

#include <node.h>
#include <v8.h>
#include <ndds/ndds_cpp.h>

using namespace v8;

Handle<Value> Method(const Arguments& args) {

  // The following is the dds code
  DDS_DomainParticipantFactoryQos factoryQoS;
  DDSTheParticipantFactory->get_qos(factoryQoS);
  /* increase max_objects_per_thread as needed.
   * The default is 1024 (512 for 4.4c and below). */
  factoryQoS.resource_limits.max_objects_per_thread = 4096;
  DDSTheParticipantFactory->set_qos(factoryQoS);


  HandleScope scope;
  return scope.Close(String::New("true"));
}

void Init(Handle<Object> exports) {
  exports->Set(String::NewSymbol("dds_resource_init"),
      FunctionTemplate::New(Method)->GetFunction());
}

NODE_MODULE(dds_resource_init, Init)

   In the javascript:

var dds_init = require('bindings')('dds_resource_init');

console.log('increase dds resource limits');

  was called before the 

var rti = require('rticonnextdds-connector');
 
var connector = new rti.Connector("myqos.xml");
 

The c++ addon was compiled with:

gyp info using node-gyp@0.10.10
gyp info using node@0.10.25 | linux | x64

  So far, such approch has not worked for us.

  Is this approach fundamentally wrong?

  Any suggestions will be appreciated!

 

 

 

gianpiero's picture
Offline
Joined: 06/02/2010
Posts: 149

Hello Jiqi,

Thanks for using the RTI Connector! My first answer was going to be to set that property in XML:
 
<participant_factory_qos>
    <resource_limits>
        <max_objects_per_thread>12</max_objects_per_thread>
    </resource_limits>
</participant_factory_qos>
 
But I tried myself and it doesn't work: unfortunately our XML parser does not support that QoS. I already filed a request (CORE-8126) so that the core can be improved.
 
As a workaround I think what you are doing is very clever, but as far as I know the C++ api (that you are using to set the qos) and the C api (that connector uses) have different participant factory. If possible i would try to do exactly what you are doing but using the C api. Basically use 
 
 
The full documentation is here.  
 
Make sense? Let me know if that work. 
 
 
Best,
  Gianpiero