On Feb 11, 2004, at 8:52 PM, Matt Jaffa wrote:
SO I was reading in the archives that if my NKE send function is
blocked(or in this case sleeping) it releases control of the funnel,
this is what could be causeing the Deadlock maybe.
And I was also reading that you have to lock it so that the state
isn't changed and won't cause this deadlock, it pointed me to
sys/lock.h
Using this how do I lock that so that it doesn't give up the funnel
while it is sleeping.
You absolutely MUST give up the funnel while sleeping. Did you mean "How do I take another lock without that potentially blocking - thus giving up the funnel anyway - and putting me right back in the same boat?" You have to use non-blocking lock tries combined with flags (set while holding the funnel) to coordinate it all. As a result, it's not easy to get right. And now you start to realize why we like to "pigeon hole" all the KEXTs. As long as you stay in category of KEXT, we have done all the dirty work for you (and largely hidden it behind somewhat standard interfaces). But once you start writing "mixed-mode" KEXTs, the encapsulation we have provided falls away. That's why it is sometimes easier to deal with a less than ideal arrangement that fits the pre-conceived notions of what a KEXT is, rather than trying to find the optimal combination of services to use. --Jim [demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s] _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.