Hi, On 12/04/13 12:49, Hans de Goede wrote: > > On 04/11/2013 05:20 PM, Toby Gray wrote: >> >> I see two possible ways of approaching the problem: >> >> 1) Add a new type, libusb_event_handle, which either maps to an FD or >> a HANDLE, as appropriate on each platform. I've attached a first >> attempt at the API changes in new_event_api.diff. It is a new API but >> is very similar to the pre-existing poll api. >> >> 2) Add the ability to start and stop async event processing threads >> which are internal to libusb. I've attached a first attempt at the >> API changes in async_thread_api.diff. >> >> I think the second approach probably matches up better with the >> future direction of hotplug. The only benefit I can really think of >> the former approach is that it allows the libusbx user to continue to >> control the thread context for transfer completion callbacks, as well >> as when the callbacks can occur. > > I don't want to come over to negative here, but I'm strongly against > method 2.
Thank you for your feedback. I think I'll give approach 1 a go as the first attempt. There will need to be a per platform event handle abstraction for either method, it's just whether it's in libusb.h or libusbi.h, which is easily modifiable once people can see what all the other changes to the os/*.c code. > Also as Pete said, lets not spend too much time talking about this, > just show us > the code :). Preferably code modeled after method 1). Will do. It might be a couple of months what with wanting to test that I've not broken any of the backends and that it does actually improve performance. Regards, Toby ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel