Re: KMDF USB: Safely handling multiple child requests

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Is OpenFile asynchronous
    ... while the createfile operation is synchronous you can on vista cancel the ... CanncelIoEx...but the driver which is implementing the create file request ... file opens... ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DFHSM CANCEL REQUEST
    ... If it is requesting a tape mount, DFHSM should have a message on the ... If you cancel the mount via the console mount request line, ... Subject: DFHSM CANCEL REQUEST ...
    (bit.listserv.ibm-main)
  • Negotiating With TimeWarnerCable (Re: KCAL keeping score)
    ... charge me $4.75 and finally send me a late bill instead of telling me ... ---when I make my annual call to TWC and request they cancel our sub. ... the reason for your cancellation request is ...
    (alt.sports.basketball.nba.la-lakers)
  • IoReadPartitionTable not returning to caller
    ... Driver's readentry point is called with new DeviceObject and new IRP ... Worker thread dequeues read request and processes it successfully ... (FPO: [Non-Fpo]) ... Cancel = 00 ...
    (microsoft.public.development.device.drivers)
  • Re: Log user in
    ... I have a login form with the login button. ... event handler method I validate user name and password in the DB. ... ONLY with the next request, since current request was without authentication ... and is it possible to use a request context to put an ...
    (microsoft.public.dotnet.framework.aspnet)