April 2020
Intermediate to advanced
412 pages
9h 58m
English
We are going to create an application that uses the real-time scheduler:
#include <iostream>#include <system_error>#include <thread>#include <chrono>#include <pthread.h>using namespace std::chrono_literals;
void ConfigureRealtime(pthread_t thread_id, int priority) { sched_param sch; sch.sched_priority = 20; if (pthread_setschedparam(thread_id, SCHED_FIFO, &sch)) { throw std::system_error(errno, std::system_category(), "Failed to set ...