Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Failed shared resource example

In our previous mutex example, the LEDs were the shared resource being protected by the mutex. Only one LED was able to blink at a time either green or blue. It would perform the entire double blink before the next double blink. 

Let's take a look at why this is important with a more realistic example. In the real world, you'll often find shared data structures and hardware peripherals among the most common resources that need to be protected.

Accessing a data structure in an atomic fashion is very important when the structure contains multiple pieces of data that must be correlated with one another. An example would be a multi-axis accelerometer providing three readings for the X, Y, and Z axes. In a high-speed ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content