2 ms·
Again, you can't ever guarantee that a thread never block or yield; it might have bugs, it might get a machine exception, it might have to deal with buggy hardw
by gpderetta 10y ago
Again, you can't ever guarantee that a thread never block or yield; it might have bugs, it might get a machine exception, it might have to deal with buggy hardware, someone might have attached an external debugger, etc. These might be rare events and not worth worrying about. And a spinlock might actually be the fastest implementation for your algorithm. It still doesn't make it lock free.
edit: ah, and you might be running under a virtualized cpu and the host takes the cpu away from you.
Edit: another one: SMM mode kicks in and takes the CPU away from the OS.