Multithreaded update of multiple ProgressBars
- by ClaudeS
I have developped an application that can process data (in my case image algorithms performed on videos). I have developed different ProcessingMethods.
Sometimes several videos are processed in parallel. Each process runs in a seperate thread.
I have a GUI with several ProgressBars, one for each thread that is processing data.
What is a good way to update the ProgressBar?
Today my GUI is creating all the processing threads and one progressBars for each thread. Then I pass those progressBars to the threads, which pass them to the ProcessingMethod. The ProcessingMethod will then update the progressbar (using Invoke(..)).
I have different processingMethods. Within each of these methods I have copy-paste code to update the progressBar. Although I am a new to programming, I know copy-paste is not good.
What is a good way to make it better?