Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synchronous vs Asynchronous DeviceRequests



On Mar 25, 2005, at 4:27 PM, Steve Bennett wrote:

I've considered making all my DeviceRequest() calls asynchronous, but there
are a *lot* of them (potentially over 20, if the device starts out in a
suspended state...) which need to be made to setup and enable this device,
and it's making for very messy and hard to maintain code, something I prefer
to avoid whenever possible. I'd like to find some mechanism which would
allow me to defer those device requests and make them all synchronously at
some later point.


As far as I can tell from my research, if I use runAction to defer the
sequence, then it's still going to block on my DeviceRequest() calls, so
that isn't a solution. Anyone know of a way to resolve this?

The solution is to start a new kernel thread to make the Syncronous calls. Look in the header file thread_call.h and in the IOUSBFamily sources in Darwin for examples on how to do this. We do it all the time in the IOUSBFamily.


Rhoads Hollowell
USB Software Team
Apple Computer, Inc.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden
References: 
 >Synchronous vs Asynchronous DeviceRequests (From: Steve Bennett <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.