Skip to main content

Posts

Showing posts from August, 2017

Real Time Scheduling Of Threads In Linux

It can be easy to get tripped up when setting up and managing real time threads in linux. In fact, I recently discovered that the thread management calls I was using within the Poco C++ library effectively did nothing. It provides an interface to set a general thread priority, but not its policy and as a result has makes no changes to the thread. Real Time Policies And The Poco ThreadPool Linux supports different thread scheduling types, called policies. For linux kernels with real time functionality, there should be support for both FIFO and round robbin real time scheduling.  SCHED_FIFO requires the thread to yield to the processor, guaranteeing that it completes its operations before another thread takes over.  SCHED_RR uses a specified time slice for the thread. I was using the Poco::ThreadPool library to set priority at thread start. This can be misleading and ineffective because it uses the SCHED_OTHER policy only, which is not a real time policy. Looking at the...