From: ShivaP on
Hi,

Created a thread in the driver and it will be running at HIGH_PRIORITY, and
I need to stop the thread by setting an event from an another dispatch Call,
which is running at PASSIVE_LEVEL.

Since the thread is running at HIGH_PRIORITY, the dispatch function is not
getting able to set the event.

Is it right to raise the IRQL in the dispatch cuntion to IRQL=DISPATCH LEVEL
before KeSEtEvent, and lower the IRQL down.

Thanks

From: Alexander Grigoriev on
As long as your HIGH_PRIORITY thread is not running away (means not using
all available CPU), but waits on events instead, there should be no problem
with setting an event on PASSIVE_LEVEL. Of course, HIGH_PRIORITY thread will
get CPU immediately, but then I don't understand why it creates a problem
for you.

"ShivaP" <ShivaP(a)discussions.microsoft.com> wrote in message
news:E63AADEF-04E7-4E0D-AED9-97224FDAD5F3(a)microsoft.com...
> Hi,
>
> Created a thread in the driver and it will be running at HIGH_PRIORITY,
> and
> I need to stop the thread by setting an event from an another dispatch
> Call,
> which is running at PASSIVE_LEVEL.
>
> Since the thread is running at HIGH_PRIORITY, the dispatch function is not
> getting able to set the event.
>
> Is it right to raise the IRQL in the dispatch cuntion to IRQL=DISPATCH
> LEVEL
> before KeSEtEvent, and lower the IRQL down.
>
> Thanks
>


From: Maxim S. Shatskih on
High priority thread is usually designed to never run long CPU-based
calculations, its purpose is to - wait for something, quickly execute
something, wait again.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim(a)storagecraft.com
http://www.storagecraft.com

"ShivaP" <ShivaP(a)discussions.microsoft.com> wrote in message
news:E63AADEF-04E7-4E0D-AED9-97224FDAD5F3(a)microsoft.com...
> Hi,
>
> Created a thread in the driver and it will be running at HIGH_PRIORITY, and
> I need to stop the thread by setting an event from an another dispatch Call,
> which is running at PASSIVE_LEVEL.
>
> Since the thread is running at HIGH_PRIORITY, the dispatch function is not
> getting able to set the event.
>
> Is it right to raise the IRQL in the dispatch cuntion to IRQL=DISPATCH LEVEL
> before KeSEtEvent, and lower the IRQL down.
>
> Thanks
>

From: Tanya Radeva [MSFT] on
Can you specify the IRQL of your running thread? Is it DPC/Dispatch and above?

The important restriction on code running at DPC level or above is that it
cannot wait for an object (an event in your case). If you do so this will
cause the scheduler to select another thread to execute which is illigal
operation because the scheduler synchronizes its data structures at
DPC/dispatch level. So if you still need a high priority thread is should be
fast (as Max said) - it does the job and goes away, no waits.

Best regards,
Tanya


"ShivaP" wrote:

> Hi,
>
> Created a thread in the driver and it will be running at HIGH_PRIORITY, and
> I need to stop the thread by setting an event from an another dispatch Call,
> which is running at PASSIVE_LEVEL.
>
> Since the thread is running at HIGH_PRIORITY, the dispatch function is not
> getting able to set the event.
>
> Is it right to raise the IRQL in the dispatch cuntion to IRQL=DISPATCH LEVEL
> before KeSEtEvent, and lower the IRQL down.
>
> Thanks
>