Protecting Data and Synchronizing Tasks

What do race conditions, corrupt data, and missed real-time deadlines all have in common? Well, for one, they are all mistakes that can be easily made when operations are performed in parallel. These are also mistakes that are avoidable (in part) through using the right tools.

This chapter covers many of the mechanisms that are used to synchronize tasks and protect shared data. All the explanations in this chapter will contain example code and analysis that will have been performed using Ozone and SystemView.

First, we will explore the differences between semaphores and mutexes. Then, you will understand how, when, and why to use a semaphore. You'll also learn about race conditions and see how a mutex ...

Get Hands-On RTOS with Microcontrollers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.