Hi,
what is the preferred method of data sharing between a dpc routine that
queues a work item. hitherto i am using the PDEVICE_EXTENSION for the
concerned
device. (all of them are from non paged memory)
however i am getting varying bugchecks each time. d i need to explicitly
lock the variables before using them.
kutty
I’m not sure what you mean by “lock the variables.” In general, any
non-paged storage would work. But it’s up to you to ensure logically safe
use (as opposed to physical backing) if the storage could be used
concurrently (eg, in an MP machine).
What’s the bugcheck? If it’s some access exception, you’re probably not
using the storage you think. Best to hook up a debugger.
–
James Antognini
Windows DDK Support
This posting is provided “AS IS” with no warranties, and confers no rights.
“Kutty Banerjee” wrote in message news:xxxxx@ntdev…
> Hi,
> what is the preferred method of data sharing between a dpc routine that
> queues a work item. hitherto i am using the PDEVICE_EXTENSION for the
> concerned
> device. (all of them are from non paged memory)
> however i am getting varying bugchecks each time. d i need to explicitly
> lock the variables before using them.
>
> kutty
>
>
>
Hi,
Let me clarify this. Between the DPC and work item i m passing variables
through the device extension. the dpc makes some changes into these
variables (non paged) and the work item accesses it.
problem is, i suspect that there are successive dpcs that are overwriting
older values and as such the work items are not getting the correct
parameters passed. So in short, perhaps 3 dpcs run before a work item gets
to run and the work item gets the values written to by the last dpc.
Is there a work around for this other than of course to have a circular
buffer of values for succesive dpcs to fill.
kutty
“James Antognini [MSFT]” wrote in message
news:xxxxx@ntdev…
> I’m not sure what you mean by “lock the variables.” In general, any
> non-paged storage would work. But it’s up to you to ensure logically safe
> use (as opposed to physical backing) if the storage could be used
> concurrently (eg, in an MP machine).
>
> What’s the bugcheck? If it’s some access exception, you’re probably not
> using the storage you think. Best to hook up a debugger.
>
> –
> James Antognini
> Windows DDK Support
>
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> “Kutty Banerjee” wrote in message news:xxxxx@ntdev…
> > Hi,
> > what is the preferred method of data sharing between a dpc routine that
> > queues a work item. hitherto i am using the PDEVICE_EXTENSION for the
> > concerned
> > device. (all of them are from non paged memory)
> > however i am getting varying bugchecks each time. d i need to explicitly
> > lock the variables before using them.
> >
> > kutty
> >
> >
> >
>
>
>
On Wed, 2004-09-01 at 10:46, Kutty Banerjee wrote:
Hi,
Let me clarify this. Between the DPC and work item i m passing variables
through the device extension. the dpc makes some changes into these
variables (non paged) and the work item accesses it.
problem is, i suspect that there are successive dpcs that are overwriting
older values and as such the work items are not getting the correct
parameters passed. So in short, perhaps 3 dpcs run before a work item gets
to run and the work item gets the values written to by the last dpc.
Is there a work around for this other than of course to have a circular
buffer of values for succesive dpcs to fill.
Well, there are a few architectural changes that can be made, but if
you’re asking if there’s a way to force your work item to run before
another DPC comes in, the answer is that there is not. Work items and
DPCs can happen at totally random times, from the perspective of the
driver.
-sd
–
Steve Dispensa
MVP - Windows DDK
www.kernelmustard.com
Are you queueing the same work item each time your DPC runs? You
realize that you cannot queue a work item if that work item is still in
the work list queue right?
If you have the chance of multiple DPCs running before the work item
runs, you either need to allocate a context every time you enqueue a
work item or keep a history (ie your circular buffer).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kutty Banerjee
Sent: Wednesday, September 01, 2004 8:47 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] comm bw dpc and work item
Hi,
Let me clarify this. Between the DPC and work item i m passing
variables
through the device extension. the dpc makes some changes into these
variables (non paged) and the work item accesses it.
problem is, i suspect that there are successive dpcs that are
overwriting
older values and as such the work items are not getting the correct
parameters passed. So in short, perhaps 3 dpcs run before a work item
gets
to run and the work item gets the values written to by the last dpc.
Is there a work around for this other than of course to have a circular
buffer of values for succesive dpcs to fill.
kutty
“James Antognini [MSFT]” wrote in
message
news:xxxxx@ntdev…
> I’m not sure what you mean by “lock the variables.” In general, any
> non-paged storage would work. But it’s up to you to ensure logically
safe
> use (as opposed to physical backing) if the storage could be used
> concurrently (eg, in an MP machine).
>
> What’s the bugcheck? If it’s some access exception, you’re probably
not
> using the storage you think. Best to hook up a debugger.
>
> –
> James Antognini
> Windows DDK Support
>
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> “Kutty Banerjee” wrote in message news:xxxxx@ntdev…
> > Hi,
> > what is the preferred method of data sharing between a dpc routine
that
> > queues a work item. hitherto i am using the PDEVICE_EXTENSION for
the
> > concerned
> > device. (all of them are from non paged memory)
> > however i am getting varying bugchecks each time. d i need to
explicitly
> > lock the variables before using them.
> >
> > kutty
> >
> >
> >
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Steve and Doron brought out the fact that you cannot assume when DPCs run,
or threads. You must code as though there could be access in any order. One
crude solution is a global spin lock on the work area. A better one in terms
of throughput would probably be to add items to a queue. It is even possible
to extend such a queue, all without locking.
–
James Antognini
Windows DDK Support
This posting is provided “AS IS” with no warranties, and confers no rights.
“Kutty Banerjee” wrote in message news:xxxxx@ntdev…
> Hi,
> Let me clarify this. Between the DPC and work item i m passing variables
> through the device extension. the dpc makes some changes into these
> variables (non paged) and the work item accesses it.
> problem is, i suspect that there are successive dpcs that are overwriting
> older values and as such the work items are not getting the correct
> parameters passed. So in short, perhaps 3 dpcs run before a work item gets
> to run and the work item gets the values written to by the last dpc.
> Is there a work around for this other than of course to have a circular
> buffer of values for succesive dpcs to fill.
>
> kutty
> “James Antognini [MSFT]” wrote in message
> news:xxxxx@ntdev…
>> I’m not sure what you mean by “lock the variables.” In general, any
>> non-paged storage would work. But it’s up to you to ensure logically safe
>> use (as opposed to physical backing) if the storage could be used
>> concurrently (eg, in an MP machine).
>>
>> What’s the bugcheck? If it’s some access exception, you’re probably not
>> using the storage you think. Best to hook up a debugger.
>>
>> –
>> James Antognini
>> Windows DDK Support
>>
>> This posting is provided “AS IS” with no warranties, and confers no
> rights.
>>
>> “Kutty Banerjee” wrote in message news:xxxxx@ntdev…
>> > Hi,
>> > what is the preferred method of data sharing between a dpc routine that
>> > queues a work item. hitherto i am using the PDEVICE_EXTENSION for the
>> > concerned
>> > device. (all of them are from non paged memory)
>> > however i am getting varying bugchecks each time. d i need to
>> > explicitly
>> > lock the variables before using them.
>> >
>> > kutty
>> >
>> >
>> >
>>
>>
>>
>
>
>