I am working on an application that communicates with an external device through a third-party COM library. I am trying to ensure that all communication with the device passes through the background thread, to prevent communication problems from screwing my application and to get rid of some other difficulties associated with the message in the user interface thread.
The problem is that whenever something happens that causes the main UI thread to block (i.e. MessageBox.Show gets called or even just moves the window around the screen), communication with the device in the background thread also stops.
Is there any way (except for a completely separate process) to split two streams far enough apart so that they do not interfere with each other? (Note that the same code with some mathematical calculations to slow things down works a bit, this is great, only when I use the COM library, I have a problem)
source share