Multithreaded update of multiple ProgressBars
Posted
by
ClaudeS
on Stack Overflow
See other posts from Stack Overflow
or by ClaudeS
Published on 2012-09-14T21:36:06Z
Indexed on
2012/09/14
21:37 UTC
Read the original article
Hit count: 162
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?
© Stack Overflow or respective owner