Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19377] Add ThreadSettings to Qos #3848

Merged
merged 23 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b0d66d5
Refs #19377: Add ThreadSettings struct
EduPonz Sep 13, 2023
81d0ee6
Refs #19377: Add ThreadSetting to Log API
EduPonz Sep 13, 2023
18ed969
Refs #19377: Add ThreadSetting to DomainParticipantFactoryQos
EduPonz Sep 13, 2023
cc7598a
Refs #19377: Add ThreadSetting to DomainParticipantQos
EduPonz Sep 13, 2023
88ea706
Refs #19377: Add ThreadSetting to TransportConfigQos
EduPonz Sep 13, 2023
685676d
Refs #19377: Add ThreadSetting to TransportDescriptorInterface
EduPonz Sep 13, 2023
ccec7e1
Refs #19377: Add ThreadSetting to SharedMemTransportDescriptor
EduPonz Sep 13, 2023
a1761a1
Refs #19377: Add ThreadSetting to FlowControllerDescriptor
EduPonz Sep 13, 2023
5b4b305
Refs #19377: Add ThreadSetting to DataReaderQos
EduPonz Sep 13, 2023
f82f4fa
Refs #19377: Add ThreadSetting to DomainParticipantQos for builtin fl…
EduPonz Sep 13, 2023
889e062
Refs #19377: Address Miguel's comments in DomainParticipant
EduPonz Sep 21, 2023
0a3eb53
Refs #19377: Address Miguel's comments in DataReader
EduPonz Sep 21, 2023
134fafe
Refs #19377: Address Miguel's comments in ParticipantTests
EduPonz Sep 21, 2023
b582bef
Refs #19377: Address Miguel's comments in QosConverters
EduPonz Sep 21, 2023
f29daf8
Refs #19377: Address Miguel's comments in Transport descriptors
EduPonz Sep 21, 2023
dfb2c3a
Refs #19377: Address Miguel's comments in DataReaderTests
EduPonz Sep 22, 2023
4e4f4fd
Refs #19377: Address Miguel's comments in RTPSParticipantAttibutes
EduPonz Sep 22, 2023
e92c0bb
Refs #19377: Address Miguel's comments in PortBasedTransportDescriptor
EduPonz Sep 22, 2023
354fb2e
Refs #19377: Add builtin_controllers_sender_thread to UpdatableDomain…
EduPonz Sep 22, 2023
43be267
Refs #19377: Refactor PortBasedTransportDescriptor accessors
EduPonz Sep 22, 2023
4b2bb7a
Refs #19377: Add TCP related thread settings
EduPonz Sep 25, 2023
d278ba0
Refs #19377: Add data_sharing_listener_thread to ReaderAttributes
EduPonz Sep 25, 2023
e55db30
Refs #19377: Fix windows warning
EduPonz Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions include/fastdds/dds/core/policy/QosPolicies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
#include <vector>

#include <fastdds/dds/core/policy/ParameterTypes.hpp>

#include <fastdds/rtps/attributes/ExternalLocators.hpp>
#include <fastdds/rtps/attributes/PropertyPolicy.h>
#include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastdds/rtps/common/LocatorList.hpp>
#include <fastdds/rtps/common/Types.h>
#include <fastdds/rtps/common/Time_t.h>
#include <fastdds/rtps/resources/ResourceManagement.h>
#include <fastdds/rtps/common/Types.h>
#include <fastdds/rtps/flowcontrol/FlowControllerConsts.hpp>

#include <fastdds/rtps/resources/ResourceManagement.h>
#include <fastrtps/types/TypeObject.h>
#include <fastrtps/utils/collections/ResourceLimitedVector.hpp>

Expand Down Expand Up @@ -2759,6 +2758,7 @@ class TransportConfigQos : public QosPolicy
(this->use_builtin_transports == b.use_builtin_transports) &&
(this->send_socket_buffer_size == b.send_socket_buffer_size) &&
(this->listen_socket_buffer_size == b.listen_socket_buffer_size) &&
(this->builtin_transports_reception_threads_ == b.builtin_transports_reception_threads_) &&
QosPolicy::operator ==(b);
}

Expand All @@ -2784,6 +2784,9 @@ class TransportConfigQos : public QosPolicy
* By default, 0.
*/
uint32_t listen_socket_buffer_size;

//! Thread settings for the builtin transports reception threads
rtps::ThreadSettings builtin_transports_reception_threads_;
};

//! Qos Policy to configure the endpoint
Expand Down
76 changes: 74 additions & 2 deletions include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#ifndef _FASTDDS_PARTICIPANTFACTORYQOS_HPP_
#define _FASTDDS_PARTICIPANTFACTORYQOS_HPP_

#include <fastrtps/fastrtps_dll.h>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastrtps/fastrtps_dll.h>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -53,7 +54,9 @@ class DomainParticipantFactoryQos
bool operator ==(
const DomainParticipantFactoryQos& b) const
{
return (this->entity_factory_ == b.entity_factory());
return (this->shm_watchdog_thread_ == b.shm_watchdog_thread()) &&
(this->file_watch_threads_ == b.file_watch_threads()) &&
(this->entity_factory_ == b.entity_factory());
}

/**
Expand Down Expand Up @@ -84,10 +87,79 @@ class DomainParticipantFactoryQos
entity_factory_ = entity_factory;
}

/**
* Getter for SHM watchdog ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& shm_watchdog_thread()
{
return shm_watchdog_thread_;
}

/**
* Getter for SHM watchdog ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& shm_watchdog_thread() const
{
return shm_watchdog_thread_;
}

/**
* Setter for the SHM watchdog ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void shm_watchdog_thread(
const rtps::ThreadSettings& value)
{
shm_watchdog_thread_ = value;
}

/**
* Getter for file watch related ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& file_watch_threads()
{
return file_watch_threads_;
}

/**
* Getter for file watch related ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& file_watch_threads() const
{
return file_watch_threads_;
}

/**
* Setter for the file watch related ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void file_watch_threads(
const rtps::ThreadSettings& value)
{
file_watch_threads_ = value;
}

private:

//!EntityFactoryQosPolicy, implemented in the library.
EntityFactoryQosPolicy entity_factory_;

//! Thread settings for the SHM watchdog thread
rtps::ThreadSettings shm_watchdog_thread_;

//! Thread settings for the file watch related threads
rtps::ThreadSettings file_watch_threads_;

};

} /* namespace dds */
Expand Down
150 changes: 149 additions & 1 deletion include/fastdds/dds/domain/qos/DomainParticipantQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

#include <string>

#include <fastrtps/fastrtps_dll.h>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp>
#include <fastrtps/fastrtps_dll.h>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -81,6 +82,12 @@ class DomainParticipantQos
(this->wire_protocol_ == b.wire_protocol()) &&
(this->transport_ == b.transport()) &&
(this->name_ == b.name()) &&
(this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) &&
(this->timed_events_thread_ == b.timed_events_thread()) &&
(this->discovery_server_thread_ == b.discovery_server_thread()) &&
#if HAVE_SECURITY
(this->security_log_thread_ == b.security_log_thread()) &&
#endif // if HAVE_SECURITY
(this->flow_controllers_ == b.flow_controllers());
}

Expand Down Expand Up @@ -321,6 +328,133 @@ class DomainParticipantQos
return flow_controllers_;
}

/**
* Getter for builtin flow controllers sender threads ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& builtin_controllers_sender_thread()
{
return builtin_controllers_sender_thread_;
}

/**
* Getter for builtin flow controllers sender threads ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& builtin_controllers_sender_thread() const
{
return builtin_controllers_sender_thread_;
}

/**
* Setter for the builtin flow controllers sender threads ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void builtin_controllers_sender_thread(
const rtps::ThreadSettings& value)
{
builtin_controllers_sender_thread_ = value;
}

/**
* Getter for timed event ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& timed_events_thread()
{
return timed_events_thread_;
}

/**
* Getter for timed event ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& timed_events_thread() const
{
return timed_events_thread_;
}

/**
* Setter for the timed event ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void timed_events_thread(
const rtps::ThreadSettings& value)
{
timed_events_thread_ = value;
}

/**
* Getter for discovery server ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& discovery_server_thread()
{
return discovery_server_thread_;
}

/**
* Getter for discovery server ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& discovery_server_thread() const
{
return discovery_server_thread_;
}

/**
* Setter for the discovery server ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void discovery_server_thread(
const rtps::ThreadSettings& value)
{
discovery_server_thread_ = value;
}

#if HAVE_SECURITY
/**
* Getter for security log ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& security_log_thread()
{
return security_log_thread_;
}

/**
* Getter for security log ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& security_log_thread() const
{
return security_log_thread_;
}

/**
* Setter for the security log ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void security_log_thread(
const rtps::ThreadSettings& value)
{
security_log_thread_ = value;
}

#endif // if HAVE_SECURITY

private:

//!UserData Qos, implemented in the library.
Expand Down Expand Up @@ -350,6 +484,20 @@ class DomainParticipantQos
*/
FlowControllerDescriptorList flow_controllers_;

//! Thread settings for the builtin flow controllers sender threads
rtps::ThreadSettings builtin_controllers_sender_thread_;
MiguelCompany marked this conversation as resolved.
Show resolved Hide resolved

//! Thread settings for the timed events thread
rtps::ThreadSettings timed_events_thread_;

//! Thread settings for the discovery server thread
rtps::ThreadSettings discovery_server_thread_;

#if HAVE_SECURITY
//! Thread settings for the security log thread
rtps::ThreadSettings security_log_thread_;
MiguelCompany marked this conversation as resolved.
Show resolved Hide resolved
#endif // if HAVE_SECURITY

};

RTPS_DllAPI extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT;
Expand Down
12 changes: 9 additions & 3 deletions include/fastdds/dds/log/Log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
#ifndef _FASTDDS_DDS_LOG_LOG_HPP_
#define _FASTDDS_DDS_LOG_LOG_HPP_

#include <fastrtps/fastrtps_dll.h>
#include <thread>
#include <sstream>
#include <atomic>
#include <regex>
#include <sstream>
#include <thread>

#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastrtps/fastrtps_dll.h>

/**
* eProsima log layer. Logging categories and verbosity can be specified dynamically at runtime.
Expand Down Expand Up @@ -131,6 +133,10 @@ class Log
RTPS_DllAPI static void SetErrorStringFilter(
const std::regex&);

//! Sets thread configuration for the logging thread.
RTPS_DllAPI static void SetThreadConfig(
const rtps::ThreadSettings&);

//! Returns the logging engine to configuration defaults.
RTPS_DllAPI static void Reset();

Expand Down
Loading
Loading