WorkItem already enqueued

here’s a snippet from the wdflogdump. we apparently queued a work item more than once. however, we are at a loss to explain how this happened in our driver.

anyone got any ideas?

any ideas on how to prevent this?

when this happened, we hit a breakpoint. when we continued, the computer froze.

1730867475: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued IoWorkItem 0x86066E48
1730867476: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued IoWorkItem 0x86066E48

thanks.

At the risk of stating the obvious: don’t do that.

Do you have a pool of one or more workitems that you use and re-use from
multiple threads of execution? Is that collection serialized so that the
obvious disasters don’t happen? Do you correctly maintain state such that
you do not re-use a workitem that is currently queued?

On Nov 16, 2007 12:04 PM, wrote:

> here’s a snippet from the wdflogdump. we apparently queued a work item
> more than once. however, we are at a loss to explain how this happened in
> our driver.
>
> anyone got any ideas?
>
> any ideas on how to prevent this?
>
> when this happened, we hit a breakpoint. when we continued, the computer
> froze.
>
> 1730867475: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued
> IoWorkItem 0x86066E48
> 1730867476: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued
> IoWorkItem 0x86066E48
>
> thanks.
>
> —
> 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
>


Mark Roddy

This means you queued a WDFWORKITEM which was already queued but whose worker routine had not run yet. Basically this means there is a driver bug where you think the worker routine will run N times, but it will only run N- depending how many times you queued the work item while it was still waiting to be dequeued.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@ddc-web.com
Sent: Friday, November 16, 2007 9:04 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WorkItem already enqueued

here’s a snippet from the wdflogdump. we apparently queued a work item more than once. however, we are at a loss to explain how this happened in our driver.

anyone got any ideas?

any ideas on how to prevent this?

when this happened, we hit a breakpoint. when we continued, the computer froze.

1730867475: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued IoWorkItem 0x86066E48
1730867476: FxWorkItem::Enqueue - WorkItem 0x86506A90 already enqueued IoWorkItem 0x86066E48

thanks.


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

we have 3 individual work items. which 2 may be queued concurrently. is this an obvious problem?

You can have as many concurrent work items as you want. What you should not
do is attempt to queue a workitem that is already in use. It appears you are
doing just that. You need some state associated with each of your workitems
that marks each work item as ‘busy’ or ‘free’. A free workitem handle queue
would do just fine. See Creating and Deleting Work Items in the WDK.

On Nov 16, 2007 2:21 PM, wrote:

> we have 3 individual work items. which 2 may be queued concurrently. is
> this an obvious problem?
>
> —
> 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
>


Mark Roddy