Does SpinMutex from spin crate not work on aarch64? #132
-
Hi! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Spin lock uses atomics under the hood, but atomics work on ARM only if you have MMU configured and enabled. MMU is introduced later than the The forever spinning isn't really spinning - CPU raises an exception, but you must have not configured the handler yet so it raises an exception from an exception handler, freezing forever (cause handlers are introduced even after MMU). |
Beta Was this translation helpful? Give feedback.
-
What @jakubfijalkowski says. On the RPi you get an exception, if you have them enabled already, if you try atomics on non-cacheable memory. There is also a hint starting tutorial 10 in Implementation of exclusive load/store (atomics) is often tied to / implemented on top of the CPU’s cache (leveraging the HW-coherency it provides). |
Beta Was this translation helpful? Give feedback.
Spin lock uses atomics under the hood, but atomics work on ARM only if you have MMU configured and enabled. MMU is introduced later than the
NullLock
, so I assume that is the case (it was in my case).The forever spinning isn't really spinning - CPU raises an exception, but you must have not configured the handler yet so it raises an exception from an exception handler, freezing forever (cause handlers are introduced even after MMU).