Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: