Re: KMDF USB: Safely handling multiple child requests
- From: "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 27 May 2006 14:05:31 -0700
b/c you need to guard access to the 2nd list entyr in the request context.
if multiple threads are canceling at the same time, the 2nd list entyr which
is used to drain to the local list can be corrupted since 2 threads can
touch it at the same time.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"hanzhu" <schumi.han@xxxxxxxxx> wrote in message
news:O2snj6ZgGHA.4892@xxxxxxxxxxxxxxxxxxxxxxx
Doron,
Can you explain why we should have only one thread to cancel the entire
subrequest list?
Thanks a lot!
Doron Holan [MS] дµÀ:
offhand I don't think any KMDF sample demonstrates this, but the basic
gist is to create a linked list of sub requests guarded by a spinlock.
the list entry for each request is in the subrequest's context. when the
irp completes, you pull it out of hte list. on cancellation, you get a
request out of the list, ref it, drop the lock, cancel it, deref it. If
you want to cancel the whole sublist, the content on each subrequest has
2 LIST_ENTRYs. you lock the list, put each request using the 2nd list
entry on a local list head, ref each request, drop the lock, drain the
local list, cancelling each request, derefing each request. you can only
have one thread doing the cancel the entire list action at a time
d
d
.
- References:
- Re: KMDF USB: Safely handling multiple child requests
- From: Doron Holan [MS]
- Re: KMDF USB: Safely handling multiple child requests
- From: hanzhu
- Re: KMDF USB: Safely handling multiple child requests
- Prev by Date: Re: Unhandled exception when pushing esi
- Next by Date: Re: Hooking IRPs
- Previous by thread: Re: KMDF USB: Safely handling multiple child requests
- Next by thread: Should I/O Completion Routines return as fast as possible for best performance ? (NDISPROT related)
- Index(es):
Relevant Pages
|