Re: KeSetEvent and context switches
- From: soviet_bloke@xxxxxxxxxxx
- Date: 25 Sep 2006 04:39:30 -0700
Hi mate
I think you just took unwise approach......
Indeed, KeSetEvent() is not atomic - unless you have set Wait to TRUE,
dispatcher database spin lock gets released and IRQL gets below
DISPATCH_LEVEL, so that context switch may occur before KeSetEvent()
returns
It is
quite strange that it does not appear on XP and W2K.
I don't know if it may be related to the OS version - you have to
discover it via disassembly. Probably, on these systems KEVENT
structure does not get accessed
by KeSetEvent() after event gets signalled. Anyway, even this is the
case, you should not assume such behaviour. Furthermore, this bug has
much, much higher chance of revealing itself on SMP machine......
The bottom line - go and fix your code
Anton Bassov
Calin Iaru wrote:
Hi *,
I have a bug which seems to be related to context switches while doing a
KeSetEvent. So, the code looks like this - 2 threads, one signals the second,
and the second frees the event. It so happens that on Server 2003 x86, the
second thread creates a new structure on the old event, and this corrupts the
event's internal state on the first thread.
It seems that KeSetEvent is not atomic, and the DDK confirms it. It is
quite strange that it does not appear on XP and W2K.
Let me know your thoughts on this,
Calin
.
- Prev by Date: Re: BDA interface for IP source
- Next by Date: Re: KeSetEvent and context switches
- Previous by thread: Can I access USB Filter Driver from user mode application?
- Next by thread: Re: KeSetEvent and context switches
- Index(es):
Relevant Pages
|