2 ms·
My take on this article is it doesn't worth implementing your own spinlock. The OS can take advantage of their implementation details while you can't portably i
by ezoe 7y ago
My take on this article is it doesn't worth implementing your own spinlock. The OS can take advantage of their implementation details while you can't portably implement it. The OS implementation changes in the future or varies.
Even if you use _mm_pause() to let CPU know it's doing spinlock, for the eye of the OS, it still looks like a busy thread, it can't be distinguished from non-spinlock computation heavy thread.