Vijairaj, can you explain how you are waiting for the hw in your design? Are you saying you want to create a request in the driver and insert it into a queue? Or you will send synchronous i/o in a work item?
As tim says, there is no thread/queue. The only overhead of a wdf queue is the size in memory (which is not that much) and a single lock.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Monday, October 29, 2007 10:09 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WDF queue overheads
xxxxx@gmail.com wrote:
I would like to know how wdf queues are implemented in the framework and
the overhead due to queues. Does every queue have a dedicated thread?
What would make you think so? No, this is not the case, nor is it even
necessary. Think about the way they are implemented. Parallel queues
dispatch immediately, on the thread of the requestor. Serial queues
only dispatch when a previous request is completed, and that’s only done
by using a WDF call, so there is already a thread to use. Manual queues
only dispatch on user request.
In each case, there is already a thread to use. No separate thread is
necessary.
I have a situation where the driver should wait for some asynchronous
input from my device at some point of time. It can either create a
workitem or create a Request and queue it to do this job. I find the
later method advantageous, but I want to know the run time overhead due
to an additional queue.
Queues are lightweight and incredibly useful. The simple fact that they
understand how to handle cancellation is in itself a huge win. The two
major lessons I have learned from my time with KMDF is “exploit queues
whenever possible” and “don’t oversynchronize”.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer