5 ms·
> I see no WTF here. Not WTF in itself, but has WTF potential. The way I read it is: If you forget to put synchronization around accesses to global state, in
by qb45 10y ago
> I see no WTF here.
Not WTF in itself, but has WTF potential. The way I read it is:
If you forget to put synchronization around accesses to global state, in addition to the usual problems, we will also overwrite your globals with random garbage.
Which sounds great when you think about debugging affected code.
> sizeof(void* )
You think that's equivalent to machine word? On 16-bit x86, for example, pointers can be either 16 or 32 bit ;)
- mike_hock 10y ago> You think that's equivalent to machine word? On 16-bit x86, for example, pointers can be either 16 or 32 bit ;) The 16bit x86 memory model is absolutely atrocious. And IDGAF what you call a "machine word" on x86, it's a 64 bit architecture grafted onto a historically grown 32 bit architecture grafted onto a historically grown 16 bit architecture grafted onto an 8 bit architecture. And when Intel tried to do a clean reboot for the 64-bit part, the market chose the grafted-on abomination instead. Also, you can have 128 bit atomic loads if you use an xmm register. But that's for the compiler to figure out when you declare an std::atomic of a 16-byte large type, not for you to assume on a plain variable, which was my point.