Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread Safety In Ringbuf Library

I'm reviewing the ringbuf library for use with FreeRTOS across two threads and I can't see how the atomic operations implemented in the library make it thread safe.  The atomic operations seem to prevent multiple writers or multiple readers from accessing a ringbuf instance until a put or get operation is complete but how is this safe if a high priority task is the reading the buffer while a low priority task writes to the buffer?

Thanks,

Darren

Related