Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stopping a high priority thread

1 view
Skip to first unread message

ShivaP

unread,
May 20, 2008, 11:16:01 PM5/20/08
to
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

Alexander Grigoriev

unread,
May 21, 2008, 12:32:23 AM5/21/08
to
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" <Shi...@discussions.microsoft.com> wrote in message
news:E63AADEF-04E7-4E0D...@microsoft.com...

Maxim S. Shatskih

unread,
May 21, 2008, 8:54:03 AM5/21/08
to
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
ma...@storagecraft.com
http://www.storagecraft.com

"ShivaP" <Shi...@discussions.microsoft.com> wrote in message
news:E63AADEF-04E7-4E0D...@microsoft.com...

Tanya Radeva [MSFT]

unread,
May 21, 2008, 5:20:05 PM5/21/08
to
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

0 new messages