Help me for a typical problem regarding KeAquireSpinLock which is not Locking other Thread in Same CPU



Hi All,
I have a typical problem regarding KeAquireSpinLock which is not
Blocking other Threads in Same CPU.
The Scenario is I've created 2 threads and in the first thread i call
KeAquireSpinLock to the same global KSPIN_LOCK variable, while its
locked by the first thread which is running the critical section, i
call the same lock in the second thread, and that also gets the lock
and starts running the critical section.
Ideally when first thread has got the lock second should wait, right?
In other words in a Single CPU Scenario a SpinLock should work like a
simple Mutex, right?? Or i'm mistaken, it doen't work at all in case of
Single CPU??
Or is it like, when one thread has got the Lock, means jumped to
Dispatch Level, other Threads will simply remain blocked??
Whatever be the Reason when Thread 1 has got the lock and thread 2 in
same CPU tries to get the same lock is not blocking untill the first
Thread releases it?? Am i doing something worng??
please Help me out, SpinLock is a new topic for me...
thanks and waiting for reply,
Rohit

.



Relevant Pages

  • 2.6.19-rc2 cpu hotplug lockdep warning: possible circular locking dependency
    ... Note that this is plain 2.6.19-rc2 (_without_ the slab cpu ... which lock already depends on the new lock. ... Using ACPI for SMP configuration information ... # ACPI Support ...
    (Linux-Kernel)
  • Re: race on multi-processor solaris
    ... > want to block if the lock holder is not running. ... and there is a CPU structure for each CPU. ... interrupts") are handled by "interrupt threads", ... Before we set the waiters bit, we grab the lock protecting the lock's ...
    (comp.unix.solaris)
  • Re: LTTng finds abnormally long APIC interrupt handler : 58.2 ms
    ... start function tracing on the kernel_softirq_raise marker and the stop ... The first one can enable tracing for the local CPU, ... unique lock identifier as I assume, or is it a pointer to a lock "class" ?) ... The output, rather long, shows the functions called with the spinlock ...
    (Linux-Kernel)
  • Re: FreeBSD mail list etiquette
    ... :their Giant kernel lock, and their network lock. ... packet if the protocol thread is on a different cpu. ... These have to do with unexpected blocking deep in a ...
    (freebsd-hackers)
  • spinaphore conceptual draft (was discussion of RT patch)
    ... performance difference is divided by the chance of the resource ... that would optimize for minimum amount of lock contention. ... If the "spinaphore" told us, ... next registered EntryPoint and a message sent to that CPU -- an interrupt of ...
    (Linux-Kernel)