Re:No nuances, just buggy code (was: related to Spinlock imp...
by kanox on Sunday January 05, 2020 @03:32PM
(#21963842)
Reserving CPUs for your application definitely qualifies as "extreme measures".
In general you should expect userspace code to be scheduled out at any time and use locking primitives that the kernel knows about.
Re:No nuances, just buggy code (was: related to Spinlock imp...
by xakahnx on Sunday January 05, 2020 @11:29AM
(#21961988)
This is still a disaster with hyperthreading where you can have two threads contending for a lock on the same physical core.
Even if your thread won't be scheduled off the core I don't know if you might still have irqs stealing time during the critical section.
Only then it makes sense tu use spin locks.