Krux02, from what I've read about lockfree (namely Jeff Preshing's blog: http://preshing.com/ ), one requirement for atomics in x86 (and other architectures) are aligned variables (I assume they must be aligned to tgeir size, that way we can make sure it resides on just one cache line). And about the types anything from 1 to four bytes.
Araq,I have already tried that, my problem is that I can't use it inside objects or tuples, and while I've yet to try I think I can't use it on type sections neither. I know MSVC always align,but how do I know gcc/clang may align my variables, from what I've tested gcc aligns global variables.
I'm new to this so I don't know much, but if I'd to say I'd guess that one reason might be performance and memory.
Gcc and clang have the "aligned" attribute and in his C atomics library Jeff Preshing was using that (together with volatile). So there must be cases where it does not align.
I am curious as to why you need aligned variables