Re: Cancel-safe without a thread?
- From: "Don Burn" <burn@xxxxxxxxxxxxxxxx>
- Date: Fri, 1 Sep 2006 19:35:16 -0400
Look at the IoCsqXXX routines, there are flaws in the method in the book!
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
<BubbaGump> wrote in message
news:mt5hf2lai33r6qujcna0nbonqgg9cc7o00@xxxxxxxxxx
On Fri, 1 Sep 2006 11:33:09 -0400, "Don Burn" <burn@xxxxxxxxxxxxxxxx>
wrote:
Invention is fine if you are solving a new problem. The problem here is
that a lot of driver writing with WDM is boilerplate code, and getting it
right is not always easy (if you search the archives of this group and the
OSR groups you will see an amazing amount of thrashing on handling cancel
before the Cancel Safe queue routines).
Back on a more technical note, I got the impression (from the WDM
driver book) that cancel-safe queues required a dedicated thread to
de-queue each IRP, and now I'm reading about some sort of custom
DEVQUEUE structure the author came up with.
A dedicated thread seems like overhead, but I'd prefer to use the DDK
as much as possible. Do I really need a dedicated thread? It looks
like I could just have my normal DPC do the de-queuing and start the
next I/O (twiddle device registers) either in my dispatch routine or
the DPC, depending on whether there was an I/O in progress. I think
I'd need a lock to protect the queue and in-progress bit/pointer
together, but it doesn't look like I could use the same lock as the
one used by the cancel-safe wrappers because the cancel-safe remove
releases the lock after its touched the queue, without leaving a
chance to atomically update another variable based on the result of
the remove.
.
- References:
- Re: Extra reference?
- From: Don Burn
- Re: Extra reference?
- Prev by Date: Re: [KMDF USB] Who is responsible for zero-length packet termination of bulk write?
- Next by Date: Re: NDIS Intermediate (passthru) communicates with second driver
- Previous by thread: Re: Extra reference?
- Next by thread: Re: Cancel-safe without a thread?
- Index(es):
Relevant Pages
|
|