3 ms·
> you can’t get so called out-of-thin-air values You can't get out-of-thin-air primitive values (no word tearing). But you can still observe states that canno
by pkolaczk 4y ago
> you can’t get so called out-of-thin-air values
You can't get out-of-thin-air primitive values (no word tearing).
But you can still observe states that cannot be explained by any possible sequential interleaving of your program. E.g. your program can do:
a = 0;
b = 0;
a = 1;
b = 1;
and another thread that does:
print(b)
print(a)
may observe 4 different combinations of values, surprisingly including also this one: { a = 0, b = 1 }
Why a corruption at a structure level should be considered less serious than tearing at a word level?
- mcculley 4y agoThe possibility of these very rare events does not change my mind about best practice for many kinds of deployed applications. I have production apps running right now using this pattern. The users would not be served better by stopping the whole app. We do capture the logs and fix the bugs encountered.