Hi!
I’ve noticed in the Windows DDK documentation that
KeClearEvent func is
better performance than the KeResetEvent
- Can anyone tell me what are really the differences
(when unassembling I
see that the difference is not so minor)
- Until now my code always used KeResetEvent - is it
safe to use the
KeClearEvent instead?
Thanks
Alon
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
The difference is that KeResetEvent has to get the current signalled state
of the event, which ivolves some work. KeClearEvent just sets the signalled
state to zero, since it doesn’t return it.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
----- Original Message -----
From: “Alon Elhanani”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 07, 2005 11:20 AM
Subject: [ntdev] KeClearEvent Vs. KeResetEvent
> Hi!
>
> I’ve noticed in the Windows DDK documentation that
> KeClearEvent func is
> better performance than the KeResetEvent
>
> 1. Can anyone tell me what are really the differences
> (when unassembling I
> see that the difference is not so minor)
> 2. Until now my code always used KeResetEvent - is it
> safe to use the
> KeClearEvent instead?
>
> Thanks
>
> Alon
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
KeClearEvent just assigns zero to the event. KeResetEvent scans the list of
the threads waiting (they are multi-waiters for sure), and ups their wait
counts.
Use KeClearEvent only if you are 100% sure there is no multi-waiting
threads on this event.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Alon Elhanani”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 07, 2005 7:20 PM
Subject: [ntdev] KeClearEvent Vs. KeResetEvent
> Hi!
>
> I’ve noticed in the Windows DDK documentation that
> KeClearEvent func is
> better performance than the KeResetEvent
>
> 1. Can anyone tell me what are really the differences
> (when unassembling I
> see that the difference is not so minor)
> 2. Until now my code always used KeResetEvent - is it
> safe to use the
> KeClearEvent instead?
>
> Thanks
>
> Alon
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Maxim S. Shatskih wrote:
KeClearEvent just assigns zero to the event. KeResetEvent scans the list of
the threads waiting (they are multi-waiters for sure), and ups their wait
counts.
Use KeClearEvent only if you are 100% sure there is no multi-waiting
threads on this event.
I hate to disagree with Mr. Shatskih, but in this case I must. I don’t
see KeResetEvent scanning any list anywhere, at least not in XP or S03
RTM or S03 SP1.
As Mr. Burn noted, KeResetEvent gets the current state of the event
before clearing it, and this state is returned to the caller.
Even more importantly, KeResetEvent holds the dispatcher database lock
while manipulating the event. Historically speaking, the dispatcher
database lock has been one of the hottest locks in the system. Thus,
it’s always nice to avoid acquiring this lock unless it’s absolutely
necessary.
Hope that helps,
Peter
OSR
Hi!
To summerize the issue - Correct me if I’m wrong:
- In case I don’t need the previous state, there is
no fear in changing my calls from KeResetEvent to
KeClearEvent?
- The issue of Multi waiting threads is not rellevant
to this issue
Alon
“PeterGV (OSR)” wrote in message
news:xxxxx@ntdev…
> Maxim S. Shatskih wrote:
> > KeClearEvent just assigns zero to the event.
KeResetEvent scans the
list of
> > the threads waiting (they are multi-waiters for
sure), and ups their
wait
> > counts.
> >
> > Use KeClearEvent only if you are 100% sure
there is no multi-waiting
> > threads on this event.
> >
>
> I hate to disagree with Mr. Shatskih, but in this
case I must. I don’t
> see KeResetEvent scanning any list anywhere, at
least not in XP or S03
> RTM or S03 SP1.
>
> As Mr. Burn noted, KeResetEvent gets the current
state of the event
> before clearing it, and this state is returned to
the caller.
>
> Even more importantly, KeResetEvent holds the
dispatcher database lock
> while manipulating the event. Historically
speaking, the dispatcher
> database lock has been one of the hottest locks in
the system. Thus,
> it’s always nice to avoid acquiring this lock unless
it’s absolutely
> necessary.
>
> Hope that helps,
>
> Peter
> OSR
>
__________________________________
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html