I have a stream of data coming in from an external source which I currently collect in a BackgroundWorker
. Each time it gets another chunk of data, it presents that data to a GUI using a ReportProgress()
call.
I get the impression that the ProgressChanged
function is just a synchronisation mechanism though so when my worker thread calls that, both threads are locked while the GUI thread processes the change. So I think the problem is that while the background thread is updating the GUI, it can't receive any data which means we lose a few packets. Is that right or is my packet dropping more likely coming frorm elsewhere?
If that is the cause, then would adding a second thread to do the GUI updating be a reasonable solution or are there better / more thorough ways of solving these problems which I ought to delve into?
Any thoughts and suggestions would be very welcome.