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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Don Burn wrote:
You are using one OldIrql globally, the OldIrql variable should be a local variable on the stack. I suspect there are other problems but that is the obvious first one. For that matter why are you allocating these at all, KIRQL and KSPIN_LOCK are both <= sizeof (PULONG) ?


Yeah like Callers of KeDelayExecutionThread must be running at IRQL <= APC_LEVEL.

The test is broken. The OP cannot "sleep" with a spinlock held. Driver verifier, as always, would have nipped this thread in the bud.
.



Relevant Pages

  • Re: Price of Creating Local Objects
    ... >is not required when you allocate objects on the stack. ... >deallocation on the stack is very fast since its just a matter of keeping ... when you say that allocating on the stack is just a matter of ... tracking the high and low addresses, that does not include the expense ...
    (comp.lang.cpp)
  • Re: Medicaid, Medicare, and Social Security
    ... imposed on them or is it something that they do as a matter of local ... I suspect that there is a difference between public ... and private hospitals. ... It would be far better to provide a legal path for immigrants to be part of our society. ...
    (soc.retirement)
  • Re: the worrying retailer rarely withdraws Angela, it proves Brahimi instead
    ... I was locking fringes to original Zack, who's allocating with respect to the ... Others even matter. ...
    (sci.crypt)
  • Re: Medicaid, Medicare, and Social Security
    ... imposed on them or is it something that they do as a matter of local ... I suspect that there is a difference between public ... and private hospitals. ... Randian born, Randian raised ...
    (soc.retirement)
  • Re: alloca / _alloca / dynamic stack memory
    ... Since my base class will be ... allocating using a locked-based method like with malloc and the ... When a developer chooses to keep an object on the stack by ... new/delete for anything other than dealing with memory management. ...
    (microsoft.public.vc.language)