Hello!
I've been experimenting with running multiple COM instances refreshing at 0.2 and hooking onto the pricesUpdated event. When running just a single COM instance everything appears hunky dory, but as i gradually added more COM instances I encountered a cascading delay effect in the response of getPrices(). I stripped everything away and created a test bed to further investigate this (see attached solution below).
This is only my best guess so I may be well off here, feel free to correct me. But I believe that pricesUpdated is called via .Invoke() which means that betting assistant will wait for my hook on the event to return before continuing its completion of that thread. I came to this assumption by adding a Thread.Delay() into my hooked method of pricesUpdated(), now this is only for the purposes of demonstration, the problem is if my hooked method doesn't return for whatever reason this will cause many threads to be queued within betting assistant which has the knock-on effect of causing any other COM activity to be severely delayed.
I ask, if this is the case, would it be possible to change the invoke of pricesUpdated delegate to instead .BeginInvoke()? which means betting assistant would continue without waiting, thus there would be no chance of a thread overload occurring.
I can understand if you don't see this as an issue and I'm sure I could better handle the hook to avoid any delayed returns but as pricesUpdated returns void anyways I figured I would ask.
PricesUpdated Test Solution (visual studio 2012)
http://s000.tinyupload.com/?file_id=159 ... 9011349748Here is the threads going out of control if the pricesUpdated hook doesn't return quickly, causing getPrices() to return slowly.
http://i.imgur.com/FtEJcZ4.jpg?1Thanks for anyhelp!