This didn’t come out as I intended, I was in a hurry and I didn’t make myself clear - apologies.
What I did mean is the queue on the other side. The problem here isn’t too many IRPs but too few, and the “queue” I wanted to refer to wasn’t the csq but the buffer itself. The issue is, of course, that if the poller is left unchecked the buffer will fill unless the csq has a steady enough supplies of IRPs to remove the payload as the poller generates it.
I don’t know if letting the app handling the buffer works any better, because all you do is to move the shared item from kernel side to user side. There’s a major difference here from a video driver, a poller is an input device while video is output. Yes, it’s easy enough to buffer output on the app side because the app controls the pace of the data generation; but if you’re polling an input device, neither the driver nor the app have any control over the amount of data provided by the input. It’s more like a camera device, you’d better be able to handle its bandwidth, buffered or not, or you’re going to get a choppy image.
The other point was correctly made by Robert Newton, which I forgot to emphasize: don’t let your threads freewheel, put them on a timer or on a semaphore.
Alberto.
----- Original Message -----
From: Maxim S. Shatskih
To: Windows System Software Devs Interest List
Sent: Saturday, April 02, 2005 1:55 AM
Subject: Re: [ntdev] Priority???
Csq does not allocate anything, it just reuses the IRP’s tail as an anchor.
The main memory hog is the buffer memory, and my suggestion is to offload this policy to the app, thus making drivers and hardware simpler.
For instance, DirectShow works this way.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Alberto Moreira
To: Windows System Software Devs Interest List
Sent: Friday, April 01, 2005 6:09 PM
Subject: Re: [ntdev] Priority???
You bump into the same problem: what do you do when you don’t have any more space to hold items in your csq ? If the software cannot keep up with the hardware, your csq is going to accumulate items jolly fast and potentially clog the system. Any kind of buffering runs into this eventual limitation, either the buffer is big enough to handle eventual differences in speed between producer (the hardware) and consumer (the user) or the system’s going to back up and you will need some flow control mechanism to avoid a system clog.
Alberto.
----- Original Message -----
From: Maxim S. Shatskih
To: Windows System Software Devs Interest List
Sent: Friday, April 01, 2005 3:01 AM
Subject: Re: [ntdev] Priority???
Send a lot of overlapped ReadFile requests, provide the cancel-safe queue for them in the driver. Then handle their completion in the user app.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: xxxxx@sunplus.com.cn
To: Windows System Software Devs Interest List
Sent: Friday, April 01, 2005 7:45 AM
Subject: [ntdev] Priority???
Dear All,
I set up a system thread in my driver. It submits a read irp to poll my device and I set a complete routine for the irp. If there is any data received, complete routine will copy the data in a buffer and resend the irp for polling. Thus if user-model AP send read request to driver, driver will get data from buffer and complete AP’s request.
My problem is that it seems the polling irp has a higher priority. If there are many data need get from device, the complete routine will be continuely called and fill the buffer up soon. At the same time I have a user-model read request but it can’t be responded in time. How could I make the ReadFile request and the polling irp synchronized?
Any advice is useful. Thanks!
Best Regards,
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com