3 ms·
I'm confused why the description refers to it as a "user level" spinlock. Are there some architectures where exchange is a privileged operation?
by michaelmior 13y ago
I'm confused why the description refers to it as a "user level" spinlock. Are there some architectures where exchange is a privileged operation?
- tsu 13y agocompare-and-swap instruction itself may not be privileged operation but user space spin-lock seldom work in user-space (it's dangerous at least), because a user thread could be preempted.
- jacquesm 13y agoWhat's even more dangerous, on a single core machine or one that is lightly loaded without any aggressive contention for the lock it may even seem to be working.
- michaelmior 13y agoAh yes, good point. I had forgotten about that issue.