On Mon, 10 Feb 2003, Duncan Sands wrote: > Yes, one advantage of a sync unlink is that you get an error code in case > of failure which you may not get with an async unlink (for example because > the urb never completes).
I think you've got that backward. If the urb never completes then the sync unlink never returns and you don't get the error code. But never mind. > This issue aside, you can ask the following > question: if sync unlink did not exit, could a driver obtain the same > effect using only async unlink (and the rest of the USB api)? > In other words, is there a logical need for sync unlink, or can it be simulated? > It seems to me that the answer is that the driver can obtain the effect of a sync > unlink, though of course it means adding all kinds of flags, locks and code to > the driver. Yes, that's right. > If this is right, the interest of a synchronous unlink routine is not due to it > adding missing functionality, but because it is convenient. Thus it seems > to me (off the top of my head), that the correct question is: can you think > of _any_ situation at all in which it would be much more convenient doing > a synchronous unlink instead of an async one? (A more general question > is: how best to reduce the hassle of using async unlink? Maybe a sync > unlink routine is not the best way to simplify things). Well I can't right now > but I do have a baby in my arms which does not help! Just so. I need to go through the existing drivers and see how they use synchronous unlinks. It may turn out to be pretty easy to convert them all to async. Or it might turn out that they are using them with the assumption that when the sync unlink returns, the completion handler is done -- in which case we should make it work like that. > The above reasoning suggests that sync unlink should be made as > convenient as possible. However, first you have to find situations in > which async unlink is particularly inconvenient and analyse them. I'll try. It means figuring out how a lot of drivers work. Alan Stern ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
