Jump to content
OpenSplice DDS Forum
Sign in to follow this  

dds_take latency growing ?

Recommended Posts

Greetings ,


I am using VortexLite .


My problem is the latency for taking sample from cache will grow up every time in multi instance.


How can I make it stable ? (can be high latency but must stable)


I just find if I close the program and run again , the latency will be reset .

But if I don't , the latency is growing . 


The image is showing the latency of dds_take for 20 times without stopping .



I want to transmit a lot of data through DDS .


In my case , I would have a lot of data writer to write sample for a single data reader .


So I used the feature of the cache (sorting and history ).


The scenario is like :


TopicA : data , TopicB : notification .


ProgramA . B and C have data writer for TopicA and TopicB.


ProgramX has data reader for TopicA and TopicB.



ProgramA . B and C are keep writing TopicA to ProgramX .


The cache in ProgramX will sorting all TopicA by keyA ,B ,C and keep all history. 


If ProgramA finishes writing , it will write TopicB to ProgramX , saying "The data is fine , you can take all" .


ProgramX will call ReadData function to take all data from ProgramA , but ProgramB and C are still writing data. 




int ReadData(void) 


  counter = 0;

  %dds_take max 256 samples for each time

  MAX_SAMPLES = 256;

  %create a handle for a target instance

  handle = dds_instance_lookup(reader,&key); 

  %initial samples
        samples = &msg;
  start_time = clock();
       ret = dds_take_instance(reader,samples,MAX_SAMPLES,info,handle,mask);
       if (ret>0 && info[0].valid_data) {
                 Buf[counter+i] = msg.data;
            counter += ret;
  }while(counter<5000);% I have 5000 data to read for each instance
  end_time = clock();
  %total clock time for moving data from cache to Buf
  total_time = (float)(end_time - start_time)/CLOCKS_PER_SEC;
  return 0;
I see an older post talking about instance key unregister problem ? 
But dds_instance_unregister didn't support data reader in VortexLite .

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this