WaitSet

3 posts / 0 new
Last post
Offline
Last seen: 3 months 1 week ago
Joined: 06/14/2024
Posts: 4
Instance-Specific Waitset

Hi,

I have an application that is subscribing to data on a specific instance. Code to do this works fine, as per the RTI worked examples:

dds::sub::LoanedSamples<DataType> samples = reader.select().max_samples(1).instance(instance_handle).read();

for (const auto& sample : samples) {
    if (sample.info().valid()) {

        std::cout << "Subscribed to InstanceID: " << sample.data().InstanceID() << std::endl;
        DataType dataOut = sample.data();

    }
}

Keywords:
3 posts / 0 new
Last post
lyq
Offline
Last seen: 2 years 6 months ago
Joined: 05/25/2020
Posts: 2
Waitset Questions

Hi, currently i am exploring a few options to retrieve data from the datareader.

I am looking at using Waitset with infinite timeout.

As i will have a lot of datareaders, therefore i will have a lot of threads using the Waitset to wait for data.

1) Can i find out when i use Waitset wait() with infinite timeout, is the thread put to sleep?

2) Will there still be any CPU utilization during the wait(), as in will the thread wakes up periodically to check if the Status Condition is triggered?

Thanks.

Keywords:
2 posts / 0 new
Last post
Offline
Last seen: 2 years 11 months ago
Joined: 02/06/2020
Posts: 4
WaitSet Spurious Wakeup

While using the traditional C++ API, is the WaitSet vulnerable to spurious wakeups?

The traditional C++ API documentation does not seem to address this, but the modern C++ API however, has an additional class called AsyncWaitSet. A quote from it's documentation:

Keywords:
3 posts / 0 new
Last post
His Nerdship's picture
Offline
Last seen: 5 years 5 months ago
Joined: 05/08/2019
Posts: 18
Adding a std::thread-based ReadCondition to a Waitset (C++)

I am writing a (modern C++) module to simulate a device that connects to a central registry to send and obtain information.  The registry and device each pass data both ways, so act as both subscribers and publishers.

Organization:
4 posts / 0 new
Last post
Offline
Last seen: 8 years 3 weeks ago
Joined: 10/21/2012
Posts: 18
Use of multiple WaitSets in one application?

Hello,

Many applcations in our system use WaitSets to detect various DDS conditions, and react accordingly.  At this stage, most, if not all, use a single WaitSet.

Are there any performance issues that one should be aware of before introducing a second WaitSet, with a different set of conditions attached, into an application?

My initial guess is that the extra WaitSet would mean at least one extra thread in the application.  But is there anything else?

Thanks in advance

Dallas

Organization:
Keywords:
1 post / 0 new
Offline
Last seen: 8 years 1 month ago
Joined: 09/14/2016
Posts: 1
Subscriber dropping samples (can't keep up ?)

I have a publisher/subscriber pair (created using  DDSTheParticipantFactory->create_participant_from_config). The subscriber uses a dynamic reader and waits on DDS_DATA_AVAILABLE_STATUS to receive new data from the publisher. At publication rates of > around 5 Hz, the subscriber begins to "miss" new samples, getting worse as the publication rate is increased. It will typically go for 1 - 3 seconds without seeing new samples, then receive a short burst (2 - 10) of consecutive samples, and repeat this cycle.

Organization:
3 posts / 0 new
Last post
Offline
Last seen: 10 years 9 months ago
Joined: 06/25/2013
Posts: 5
AccessViolationException on program shutdown

Hello,

I'm encountering the following unhandled exception in nddsdotnet40.dll when my application shuts down:

System.AccessViolationException was unhandled
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=nddsdotnet40
StackTrace:
at DDS.WaitSet.!WaitSet()
at DDS.WaitSet.Dispose(Boolean )
at DDS.WaitSet.Finalize()
InnerException:

I've traced through all my Dispose() methods and it doesn't seem that anything is directly causing this exception.

Keywords:

Proper use of WaitSets and Conditions

I have noticed in our support forums a common question regarding the use of WaitSets and the fact that sometimes they don't behave as people initially expect. Often the question is posed along the lines of "Why does my WaitSet not block? Why does my subscriber using WaitSets consume so much CPU?

Organization:
Subscribe to RSS - WaitSet