On Tue, Aug 11, 2009 at 11:29 PM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
Hm, I think this document explains a bit about queued spinlock:On Tue, Aug 11, 2009 at 5:42 PM, Prasad Joshi<prasadjoshi124@xxxxxxxxx> wrote:
> I am working on Porting of a windows device driver to Linux. Windows has a
> notion of Queued Spinlock. I could not understand how it is different than
> normal spinlock, the document says it is faster than a normal spinlock.
>
> If any one is having more information on Queued Spinlock, please share.
>
> Is there any equivalent Spinlock in Linux to Queued Spinlock?
http://msdn.microsoft.com/en-us/library/aa490204.aspx
AFAIK, Linux's spin lock doesn't guarantee ordering. So, the best
Linux alternative is just use normal spinlock.
NB: Perhaps you should question yourself first "do we really need
locking ordering in First Come First served here?"
Linux uses 'ticket spinlocks', at least on x86 architecture. I had never heard of MS's queued spinlocks before, but this seems to be similar.
See arch/x86/include/asm/spinlock.h
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.