atomicLoad/Store

Brad Roberts braddr at puremagic.com
Mon Aug 5 16:04:05 PDT 2013


On 8/5/13 1:22 PM, zyhong wrote:
>  From my understanding, any data type that is less than 32bit (bool, char, int, etc) is atomic and
> there is no need to use atomicLoad/Store and read/write the data to be thread safe. In
> std.parallelism, I saw it use atomicLoad/Store for any shared data. Could anyone clarify if it is
> really necessary to atomicLoad/Store to read/write data that datatype is bool, int, byte, etc?

For most platforms, writing anything other than a register word size is NOT atomic.


More information about the Digitalmars-d mailing list