diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -42,6 +42,17 @@ void sig_int_handler(int) { running = false; } +static 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; +} + + size_t read_samples_from_file(FILE* fd, std::vector<complexf>& samples, size_t count) { if (samples.size() < count) { @@ -180,7 +191,6 @@ void analyse_correlation() } } - int main(int argc, char **argv) { double txgain = 0; @@ -207,6 +217,8 @@ int main(int argc, char **argv) return -1; } + set_realtime_prio(1); + std::string uri = argv[1]; zmq::context_t ctx; |