|
From: Stephan M. <ste...@we...> - 2006-09-28 18:55:55
|
I tried the same on my system (WinXP, 2GHz CPU) and my test program
(code attached) consumes less than 5% of CPU resources.
But if I enable debugging by calling usb_set_debug(4) and if I connect
a tool such as DebugView to capture the debug messages then CPU
load goes up to 80%.
Try to disable debug messages by calling usb_set_debug(0) after usb_init().
My test program also calls usb_find_devices() from a seperate thread and
it doesn't crash (as you mentioned in your other mail). If I unplug my device
then the application just terminates.
The current DLL isn't fully thread safe but refreshing the device list from
a second thread shouldn't crash the DLL.
Which version of the DLL are you using? Have you tried one of the latest
development versions?
Stephan
>
> Hi,
>
>
> I'm encountering performance problems. The code below runs on a linux system with for abot 1400 cycles per second, not consuming a lot of CPU. This is near the theoretic maximum. Under windows it runs at less than 800 cycles, taking 70% of the CPU, mostly kernel times. Any ideas.
>
>
> for (;;) {
>
> while (usb_interrupt_read(MyHandle, 0x88, (char*)Buffer, sizeof(Buffer), 1000) < 0) ;
>
> // build Command
>
> usb_interrupt_write(MyHandle, 0x04, (char*)Command, 5, 1000);
>
> }
>
>
> Thanks,
>
> Steffen
>
> -----------------------------------------------------------------
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> -----------------------------------------------------------------
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
|