Remix.run Logo
magicalhippo 9 hours ago

But the mutex encapsulates the int, so if the mutex ensured it occupied a multiple of cache lines, there would be no contention. At the very small cost of a few bytes of memory.

gpderetta 9 hours ago | parent [-]

the mutex forcing alignment would be extremely wasteful. FWIW, I have used 1-bit spin locks.