Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by unwind for FreeRTOS locks and tasks

Yes, you should use locks to protect access to the shared resource.

You can't be sure that the sequence generated by the compiler to read the shared variable is atomic, so it might be unsafe.

If you want to be a bit more hard-core, possibly gaining performance, you can use various ways to actually ensure that the variable can be accessed atomically. See comment.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>