|
|
|
|
|
by avianes
857 days ago
|
|
Are you aware that x86 and ARM/POWER/RISCV memory consistency model are really different?
You can encounter very sneaky multitreading bug when running on ARM/POWER/RISCV a program that you have only tested on x86. Apple has actually put a lot of effort to make the x86 to ARM transition as smooth as possible regarding memory consistency model, this is a strong indication that it's not as trivial as you seem to think. |
|
RISC-V has a standardised (optional) TSO memory model mode, plus "fence.tso" instruction that works in normal mode, even on CPUs that predate it (it defaults to the stronger "fence rw,rw" in that case). Well, assuming the CPU core designer read the spec carefully and doesn't trap on unknown "fence" instructions (looking at you, THead...)