From c9ea7fb88809d935f3eaeee108415ff5abd17ead Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 5 Jun 2015 09:10:52 +0200 Subject: Set priorities for modulator and UHD threads --- src/DabMod.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/DabMod.cpp') diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 2fe8d53..57f03b9 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -768,6 +768,15 @@ int launch_modulator(int argc, char* argv[]) } #endif + // Set thread priority to realtime + const int policy = SCHED_RR; + sched_param sp; + sp.sched_priority = sched_get_priority_min(policy); + int thread_prio_ret = pthread_setschedparam(pthread_self(), policy, &sp); + if (thread_prio_ret != 0) { + etiLog.level(error) << "Could not set priority for Modulator thread:" << thread_prio_ret; + } + while (run_again) { Flowgraph flowgraph; -- cgit v1.2.3