diff --git a/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp index d8203a1165c..b2d9573d356 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp @@ -41,7 +41,7 @@ class AnnotationDescriptorImpl : public virtual AnnotationDescriptor virtual ~AnnotationDescriptorImpl() = default; - traits::ref_type type() const noexcept override + traits::ref_type type() const override { return type_; } diff --git a/src/cpp/rtps/DataSharing/DataSharingListener.cpp b/src/cpp/rtps/DataSharing/DataSharingListener.cpp index ce1693f50eb..acc9ab29b0d 100644 --- a/src/cpp/rtps/DataSharing/DataSharingListener.cpp +++ b/src/cpp/rtps/DataSharing/DataSharingListener.cpp @@ -129,7 +129,7 @@ void DataSharingListener::stop() listening_thread_.join(); } -void DataSharingListener::process_new_data () +void DataSharingListener::process_new_data() { EPROSIMA_LOG_INFO(RTPS_READER, "Received new data notification"); @@ -138,7 +138,10 @@ void DataSharingListener::process_new_data () // It is safe to 'forget' any change now notification_->notification_->new_data.store(false); // All places where this is set to true is locked by the same mutex, memory_order_relaxed is enough - writer_pools_changed_.store(false, std::memory_order_relaxed); + // Using Acquire-Release semantics can avoid some blocking problems in traditional locking, such as deadlock and priority inversion. + // This usually means higher concurrency performance because threads don't have to wait for locks to be released. + // Through Acquire-Release, you can achieve finer-grained control over specific variables or data structures without having to lock the entire resource or object, which can reduce contention and improve concurrency. + writer_pools_changed_.store(false, std::memory_order_release); // Loop on the writers looking for data not read yet for (auto it = writer_pools_.begin(); it != writer_pools_.end(); ++it) @@ -199,7 +202,7 @@ void DataSharingListener::process_new_data () } } - if (writer_pools_changed_.load(std::memory_order_relaxed)) + if (writer_pools_changed_.load(std::memory_order_acquire)) { // Break the while on the current writer (it may have been removed) break; @@ -209,7 +212,7 @@ void DataSharingListener::process_new_data () // Lock again for the next loop lock.lock(); - if (writer_pools_changed_.load(std::memory_order_relaxed)) + if (writer_pools_changed_.load(std::memory_order_acquire)) { // Break the loop over the writers (itearators may have been invalidated) break; @@ -313,4 +316,4 @@ std::shared_ptr DataSharingListener::get_pool_for_writer( } // namespace rtps } // namespace fastdds -} // namespace eprosima +} // namespace eprosima \ No newline at end of file diff --git a/test/performance/latency/README.md b/test/performance/latency/README.md index c8b3a6fef72..470a7b8707c 100644 --- a/test/performance/latency/README.md +++ b/test/performance/latency/README.md @@ -103,6 +103,10 @@ The utility offers several options: | --security=[true/false] | Enable/disable DDS security | | --certs=\ | Directory with the certificates. Used when security is enable | +**Container Tips** +Shared_memory and data_sharing technologies have pre-allocated memory pools underneath. This memory value occupies the system's free memory segment. To put it simply, the size of +the sent data packet will affect the amount of allocated memory, which is probably shm: 1:5 data_sharing 1:31. If the data packet size is 100MB data, in data_sharing mode +At least 3.1g of memory is required. docker run -it --shm-size=3.1g my-image. **Publication options** diff --git a/test/performance/throughput/README.md b/test/performance/throughput/README.md index e4d4c77f418..bff8ab3b064 100644 --- a/test/performance/throughput/README.md +++ b/test/performance/throughput/README.md @@ -105,6 +105,7 @@ The utility offers several options: | --certs=\ | Directory with the certificates. Used when security is enable | + **Publication options** | Option | Description | @@ -141,6 +142,10 @@ The file with the demands has the format of each line the data size separated of This examples will execute four tests: one sending bursts of 100 samples of 16 bytes, other test sending bursts of 1000 samples of 16 bytes, , other sending bursts of 100 samples of 32 bytes and the last one sending bursts of 1000 samples of 32 bytes. +**Container Tips** +Shared_memory and data_sharing technologies have pre-allocated memory pools underneath. This memory value occupies the system's free memory segment. To put it simply, the size of +the sent data packet will affect the amount of allocated memory, which is probably shm: 1:5 data_sharing 1:31. If the data packet size is 100MB data, in data_sharing mode +At least 3.1g of memory is required. docker run -it --shm-size=3.1g my-image. ### Examples @@ -185,3 +190,8 @@ The python scripts offers several options: | -t \ | Test time in seconds. Default is *1 second* | | -r \ | A CSV file with recovery time | | -f \ | A file containing the demands | + +**Container Tips** +Shared_memory and data_sharing technologies have pre-allocated memory pools underneath. This memory value occupies the system's free memory segment. To put it simply, the size of +the sent data packet will affect the amount of allocated memory, which is probably shm: 1:5 data_sharing 1:31. If the data packet size is 100MB data, in data_sharing mode +At least 3.1g of memory is required. docker run -it --shm-size=3.1g my-image. \ No newline at end of file