device filtering support

Pete Batard pete at akeo.ie
Sat Feb 4 09:11:28 EST 2012


On 2012.02.04 01:25, Xiaofan Chen wrote:
> On Sat, Feb 4, 2012 at 2:47 AM, Vitali Lovich<vlovich at gmail.com>  wrote:
>> I'm going to have to side with Travis - spawning a secondary
>> process seems unnecessary&  wasteful.
>
> This is especially disturbing if it becomes compulsory for all
> libusb applications.

I don't see creating a process as that different from creating a thread, 
which we already do. How exactly is that disturbing? Because users would 
now see a separate entity whereas with a thread they don't?

>> Maybe if libusb applications were likely to run simultaneously
>> with a lot of other libusb applications it might make sense
>> (&  even then not so much).
>
> The thing is those small amount of use cases should not
> penalize the majority of the use cases.

Again, how will it penalize users. We have to create a thread on 
Windows, for hotplug, so creating a process instead will hardly be more 
penalizing. You end up with code running in parallel in both case, the 
difference being that one goes through a one time full process init, and 
the other doesn't.

> Take note libusbK.dll supports libusb0.sys, libusbK.sys and
> WinUSB.sys. Therefore using libusbK.dll covers most of the
> driver used and only the HID is an exception.
>
> However, Pete indicated that he would like to keep the
> standalone WinUSB backend, so that will keep a lot of
> duplicate codes inside the Windows backend.

Please do not distort the facts according to the point you are trying to 
make. As I have now told both you and Travis twice, the issue with 
forcing all users to go through libusbK always for WinUSB accesses is as 
follows:
- It makes it mandatory to have libusbK installed along with libusbx on 
Windows
- We very much have existing commercial users that rely on 
libusb-1.0/WinUSB and who created a custom installer (one that doesn't 
use libwdi) to install WinUSB. We can't exactly go back an tell them:

"- Well, you will have to spend time modifying your installer and make 
it install the libsubK library along WinUSB...
- Why? Will I see any benefit from doing that?
- Not really. But it's just _slightly_ easier for us to do it that way..."

> Anyway, since Pete thinks that it will not cause performance
> penalty and he seems to want to try out his ideas, let's
> wait for his implementation. We may also prepare some
> benchmarks to see how that is the case or not the case.

Sure. Will come after hoptlug and cross-platform event handling, so 
we're still a long way off.

Regards,

/Pete




More information about the libusbx mailing list