From 774ec86d8b6712990f83ba5a8ccac8359f3f9306 Mon Sep 17 00:00:00 2001 From: srvald Date: Fri, 3 Jul 2026 08:35:28 +0200 Subject: [PATCH 1/3] refactor: add FIFO scheduling max priority to the RTDE background thread --- src/rtde/rtde_client.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rtde/rtde_client.cpp b/src/rtde/rtde_client.cpp index bdac1a733..fc6784036 100644 --- a/src/rtde/rtde_client.cpp +++ b/src/rtde/rtde_client.cpp @@ -30,6 +30,7 @@ #include "ur_client_library/exceptions.h" #include "ur_client_library/log.h" #include "ur_client_library/rtde/data_package.h" +#include "ur_client_library/helpers.h" #include #include #include @@ -964,6 +965,10 @@ void RTDEClient::stopBackgroundRead() void RTDEClient::backgroundReadThreadFunc() { + pthread_t this_thread = pthread_self(); + const int max_thread_priority = sched_get_priority_max(SCHED_FIFO); + setFiFoScheduling(this_thread, max_thread_priority); + while (background_read_running_) { std::unique_lock lock(reconnect_mutex_, std::defer_lock); From ad914504e51561d6a11b1806f5e9ab2408d50f47 Mon Sep 17 00:00:00 2001 From: srvald Date: Fri, 3 Jul 2026 08:55:41 +0200 Subject: [PATCH 2/3] refactor: set fifo scheduling true by default --- include/ur_client_library/comm/pipeline.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ur_client_library/comm/pipeline.h b/include/ur_client_library/comm/pipeline.h index dbd7b0e04..df70ebe23 100644 --- a/include/ur_client_library/comm/pipeline.h +++ b/include/ur_client_library/comm/pipeline.h @@ -303,7 +303,7 @@ class Pipeline * \param producer_fifo_scheduling Should the producer thread use FIFO scheduling? */ Pipeline(IProducer& producer, IConsumer* consumer, std::string name, INotifier& notifier, - const bool producer_fifo_scheduling = false) + const bool producer_fifo_scheduling = true) : producer_(producer) , consumer_(consumer) , name_(name) @@ -322,7 +322,7 @@ class Pipeline * \param notifier The notifier to use * \param producer_fifo_scheduling Should the producer thread use FIFO scheduling? */ - Pipeline(IProducer& producer, std::string name, INotifier& notifier, const bool producer_fifo_scheduling = false) + Pipeline(IProducer& producer, std::string name, INotifier& notifier, const bool producer_fifo_scheduling = true) : producer_(producer) , consumer_(nullptr) , name_(name) From 8d93a8508f78e2bbb4381fcc3528b60b85c1e69a Mon Sep 17 00:00:00 2001 From: srvald Date: Mon, 6 Jul 2026 10:55:12 +0200 Subject: [PATCH 3/3] fix: set default producer_fifo_scheduling value back to false --- include/ur_client_library/comm/pipeline.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ur_client_library/comm/pipeline.h b/include/ur_client_library/comm/pipeline.h index df70ebe23..dbd7b0e04 100644 --- a/include/ur_client_library/comm/pipeline.h +++ b/include/ur_client_library/comm/pipeline.h @@ -303,7 +303,7 @@ class Pipeline * \param producer_fifo_scheduling Should the producer thread use FIFO scheduling? */ Pipeline(IProducer& producer, IConsumer* consumer, std::string name, INotifier& notifier, - const bool producer_fifo_scheduling = true) + const bool producer_fifo_scheduling = false) : producer_(producer) , consumer_(consumer) , name_(name) @@ -322,7 +322,7 @@ class Pipeline * \param notifier The notifier to use * \param producer_fifo_scheduling Should the producer thread use FIFO scheduling? */ - Pipeline(IProducer& producer, std::string name, INotifier& notifier, const bool producer_fifo_scheduling = true) + Pipeline(IProducer& producer, std::string name, INotifier& notifier, const bool producer_fifo_scheduling = false) : producer_(producer) , consumer_(nullptr) , name_(name)