Top "Spinlock" questions

A spinlock is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available.

High system CPU usage when contending futex

I have observed that when the linux futexes are contended, the system spends A LOT of time in the spinlocks. …

linux spinlock futex
Fastest inline-assembly spinlock

I'm writing a multithreaded application in c++, where performance is critical. I need to use a lot of locking while …

c++ assembly x86 memory-barriers spinlock
Spinlock vs Busy wait

Please explain why Busy Waiting is generally frowned upon whereas Spinning is often seen as okay. As far as I …

spinlock busy-waiting
Why is "sleeping" not allowed while holding a spinlock?

Possible Duplicate: Why can't you sleep while holding spinlock? As far as I know, spinlocks should be used in short …

c synchronization linux-kernel sleep spinlock
onSpinWait​() method of Thread class - Java 9

While learning Java 9 features I came across a new method of Thread class, called onSpinWait​. As per javadocs, this method …

java multithreading concurrency java-threads spinlock
Disabling all interrupts to protect CPU register state on multi processor systems

I need to ensure in a code portion (in kernel mode) that no one else can modify/check the CR0 …

linux-kernel multicore interrupt spinlock
Why linux disables kernel preemption after the kernel code holds a spinlock?

I am new to Linux and am reading Linux device drivers book by Rubini & Corbet. I am confused at …

kernel driver spinlock preemption
Linux Kernel: Spinlock SMP: Why there is a preempt_disable() in spin_lock_irq SMP version?

The original code in Linux kernel is: static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) { local_irq_…

c linux kernel spinlock smp