From: Jamey Kirby [jkirby@storagecraft.com]
Sent: Wednesday, August 29, 2001 2:22 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Virtual SCSI miniports + requests comlpletion...

If you look at FAST FAT. It uses an internal counter and will not post
more than two (I IRC) work items at a time. This is to keep the FSD from
deal-locking on itself or with anyone else using the work item
components; I suspect.

In my first disk filter driver, I was using a work item for the read
path and a work item for the write path. As soon as the disk activity
got high I would dead-lock. I reworked the code to use two separate
threads. No more dead-lock.

In our more recent work item code, we create and destroy threads
dynamically as required to prevent dead-lock.

Jamey
jkirby@storagecraft.com
 

-----Original Message-----
From: bounce-ntdev-562@lists.osr.com
[mailto:bounce-ntdev-562@lists.osr.com] On Behalf Of
anton_kolomyeytsev@hotmail.com
Sent: Thursday, August 30, 2001 1:44 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Virtual SCSI miniports + requests comlpletion...


> We have developed a driver in the past that used ExXxxWorkItems. The 
> driver was a disk filter. If the FSD has used all of the workitems to 
> process FSD requests, when you get to the lower-driver, there are no 
> work items left. So, you get a dead-lock. The FSD is waiting for the 
> disk and the disk is waiting for a work item; which will not become 
> available until the FSD releases one. DEADLOCK. I have seen it several

> times in several drivers; my own and other client drivers.

Now I understand. I've imagined something like this... The only problem
I 
see: if the system will not crash in your driver (because FSD holds all 
work items, I mean all system threads are blocked in work item
callbacks) 
if will crash in the very first call to ExQueueWorkItem() (or IoXxx work

item code). So it will be your driver or not your driver - system will 
crash in any case. Because of low resources... Am I correct?

> It is far better to write your own workitem code using 
> PsCreateSystemThread(). We have such code and it is quarantined to be 
> dead-lock free.

And use KeAttachProcess()/KeDetachProcess)() in own thread? 

> If you want a copy, send me a private email.

Thank you very much for your code.

---
You are currently subscribed to ntdev as: jkirby@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com


---
You are currently subscribed to ntdev as: GlennEverhart@FirstUSA.com
To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com