Page 1 of 1

Are reads/writes to floating point variables atomic?

Posted: Tue Feb 13, 2018 6:46 am
by asamson
Hi,

My application has two tasks. The first one updates a floating point variable and the other reads this variable. Do I need to protect access to this variable using a mutex or are read/write accesses atomic in this case?

Re: Are reads/writes to floating point variables atomic?

Posted: Thu Feb 15, 2018 3:44 am
by ESP_Angus
If they're 32-bit floats, then any load/store is atomic.

If they're 64-bit doubles, then these are not atomic.