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...
The Yocto build platform is very powerful, with many options and the ability to quickly incorporate new packages into an embedded linux distribution via bitbake recipes. If you are building up a system for deployment, you'll find that there are several packages you'll need that may not be readily available out of the box. In my case, I am using the builder supplied by Phytec, an embedded hardware manufacturer. Their default package didn't include the system logger, which I find to be crucial for any moderately complex system. No worries, with a little effort this can be added to the system. Another key function is log management. A deployed system cannot have files which grow in size indefinitely. Logrotate is a handy utility for managing this. Installing The Syslog Plus A Log Rotation Service In my example, I'm using Arch Linux with systemd for service management. The builder toolkit comes with the rsyslog recipe. I'm appending to this recipe in my own m...