hi, Halil Demirezen wrote: > in linux/spinlock.h the spinlocks are defined > and i want to know what kind of a reasonability does it have to define > spin_lock and spin_unlock in the following way. > > > #define spin_lock(lock) do {} while(0) > #define spin_unlock(lock) (void)... > that's the definition for UP, not preemptible kernel (they don't need spinlock). the real spinlock for SMP are defined (#ifdef CONFIG_SMP) in the architecture dependant headers (<asm/spinlock.h>). if the kernel is preemptable (2.5 or patched) even uniprocessor machines have to care about race conditions so there's another #ifdef who add preempt lock stuff at the spinlock. Gianluca -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/