Multiple Instances .. sharing image

BlitzPlus Forums/BlitzPlus Programming/Multiple Instances .. sharing image

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

You may want to make an estimate of the CPU load using Blitz, and see if Blitz can perform the polling and update the graphics from just one instance. Blitz has very quick graphic routines and number crunching capabilities. You may be able do everything from one Blitz window. I don't think that you will get better response from multiple instances for each port since you are still in the Windows environment, the OS will still need to manage the time slices necessary for your program(s) to read from the ports and update the graphics. You can set up a scheme programatically that would do the same, only you will have a lot more control of how the time is sliced.

For the CPU load estimate, you need to know how often the USB ports are polled each second and how often the graphics need to be updated. You could make a window divided into six regions/areas then use a "frames per second" loop to see how fast the graphics that you are using take to display.

As far as the USB ports, each port has a maximum thoughput of ~1 Mbit per sec for USB_1 or ~12 Mbit per sec for USB2, so even with USB2 using maximum throughput, times 6 ports is 72 Mbit per sec. On a 733Mhz system, you could use up to 10 machine cycles per bit polled. On a 3.2Ghz system you could use up to 43 machine cycles per bit polled. That's the worst case scenario for 6 USB ports. If as you mentioned that there will be less data, then you will have proportionately more time.

Using the above benchmarks should give you a crude estimate as to how your app will respond in a real time environment when using Blitz or any other programming language that you are evaluating.