4 ms·
It might or might not be hard to compile for a different cpu. Intel lets you play fast and loose with mutil threaded code without as many race conditions. As a
by bluGill 6y ago
It might or might not be hard to compile for a different cpu. Intel lets you play fast and loose with mutil threaded code without as many race conditions. As a result code that works fine on Intel often randomly gives wrong results on arm. Fixing this can be very hard.
Once it is fixed you are fine. Most of the big programs you might use are already fixed. Some languages give you gaurentees that make it just work.
- FnuGk 6y agoWhat is different on intel since you can play fast and loose with multi threading? Two threads reading and writing the same memory area without and locking would give problems regardless of the ISA or am i missing something?
- prattmic 6y agoARM has a weakly-ordered memory model, while x86 is much more strongly-ordered. See https://en.wikipedia.org/wiki/Memory_ordering#Runtime_memory_ordering https://en.wikipedia.org/wiki/Memory_ordering#Runtime_memory.... So e.g., on x86 if you store to A then store to B, then if another core sees the store to B it is guaranteed to see the store to A as well. This guarantee does not exist on ARM.
- petters 6y agoThe C++ standard is famously complicated about atomics and memory order (for a good reason): https://en.cppreference.com/w/cpp/atomic/memory_order https://en.cppreference.com/w/cpp/atomic/memory_order But on x86, many of these things don't matter, if I understand correctly.
- jfkebwjsbx 6y agoYes, you are missing something. Two threads reading and writing to the same memory area do not necessarily give problems. In fact, many software is built to exploit several facts about how memory accesses work with respect each other. ARM processors give very few guarantees, so code has to workaround that.