3 ms·
as for the synchronization use case, even though it's probably way more expensive to invalidate another thread's instruction cache than any other usual sync. me
by obl 11y ago
as for the synchronization use case, even though it's probably way more expensive to invalidate another thread's instruction cache than any other usual sync. method, it can be useful if there is a huge number of synchronization point but it happens very rarely and you don't want to bloat the code with explicit checks everywhere.
An example of that is garbage collection safepoints, although in that case you also need to be able to patch a function in the middle (any potentially unbounded control flow loop)