One thing I had to learn the hard way is that a spin lock is a bad fit the moment your threads can be preempted mid critical section. Under oversubscription you're spinning against a thread that isn't even scheduled.
Yeah that's quite right, you shouldn't be using spinlock without pinned threads
Thanks for sharing! Happy to get feedback :)
Note that I don't recommend spinlock for most cases, only when there is a 1:1 mapping between threads and phsycal CPU cores, and only after measuring