lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, May 20, 2020 at 11:16 PM connor horman <chorman64@gmail.com> wrote:
>
>> Atomics may break arbitrarily if multithreading is used.
>
> (Appologies for the double post, hit Send by accident). Just because it does work now does not mean that a different platform, or even a random compiler optimization would not break stuff. Data races are a really nice footgun, as they can even happen on a whim. Maybe You started the program on an odd numbered cycle, so the read order is broken. So many ways a data race that seemingly works "fine" can just arbitrarily break.

Are you sure about that? My understanding is that the whole point of
atomics is that they do have a well-defined memory model and may *not*
break arbitrarily just because multithreading is used.

Joseph C. Sible