From 93d8c6f83b35ca08b009a02b7109e09f4e4e43b1 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 2 Oct 2019 16:35:06 -0500 Subject: uhd: Add thread affinity utility functions --- host/include/uhd/utils/thread.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/utils/thread.hpp b/host/include/uhd/utils/thread.hpp index 05cba0d14..aeb27e467 100644 --- a/host/include/uhd/utils/thread.hpp +++ b/host/include/uhd/utils/thread.hpp @@ -56,6 +56,12 @@ UHD_API void set_thread_name(boost::thread* thread, const std::string& name); */ UHD_API void set_thread_name(std::thread* thread, const std::string& name); +/*! + * Set the affinity of the current thread to a (set of) CPU(s). + * \param cpu_affinity_list list of CPU numbers to affinitize the thread to + */ +UHD_API void set_thread_affinity(const std::vector& cpu_affinity_list); + } // namespace uhd #endif /* INCLUDED_UHD_UTILS_THREAD_HPP */ -- cgit v1.2.3