From e48df9cb5ec9e48cd836ec227127f42c5cc99aa1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 17 Jun 2016 11:26:57 +0200 Subject: Set SCHED_RR prio for all data processing threads This includes Modulator, FIR Filter and UHD worker --- src/Utils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Utils.cpp') diff --git a/src/Utils.cpp b/src/Utils.cpp index 4805374..ab1866c 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -114,4 +114,13 @@ void printVersion(void) } +int set_realtime_prio(int prio) +{ + // Set thread priority to realtime + const int policy = SCHED_RR; + sched_param sp; + sp.sched_priority = sched_get_priority_min(policy) + prio; + int ret = pthread_setschedparam(pthread_self(), policy, &sp); + return ret; +} -- cgit v1.2.3