On Thu, 13 Oct 2005, Pete Zaitcev wrote: > > The whole application cannot exit and leave URBs running behind, > because usbdevio_release() blocks until they are terminated.
Wrong. You just do a fork(), and a close in the parent. "release()" won't be called until the _last_ close, and the task that opened the fd can certainly exit before that. If you want to have something that is called on each close, you can trigger on the "flush()" VFS call, but then you have to realize that that can happen an infinite number of times, and while the original one is open (ie on a fork, if the _child_ calls close(), then you'll get a flush, even though the original fd is still open and still in use). So you really don't want to terminate the URB's in "flush()". Which means that the original process can very much be long gone when release happens. It's a fundamental mistake to think that file descriptors stay with the process that opened them. Linus ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel