Re: Usage semantics of atomic_set ( )
From: Vineet Gupta
Date: Sat Jan 12 2008 - 13:37:16 EST
> What operations are you using to implement spinlocks?
The cpu provides atomic exchange instruction (atomic Read/write
semantics) which forms the back end of spin lock code.
__raw_spin_trylock( ) atomically swaps the lock memory with a reg (set
to 1)
Using a pool of spinlocks rather that original idea of spinlock per
atomic_t anyways seems to be a better idea.
I really appreciate the responses. Thanks a lot
-Vineet
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/