Using multiple progress indicators for multiple threads without jamming the GUI

I am writing an RCP Eclipse application in which several threads will update the user as they progress, each through their own progress bar in the GUI. I was told that in order for each of them to individually update its own progress bar, it could potentially cause a conflict over a shared resource (I believe one of the parent progress bar, for example Shell). It's true?

I was asked to create an intermediate class with synchronized methods, which will act as a serializing sequence for calling updates from threads. Is this a solution? Can you suggest a better solution?

+6
source share
1 answer

This is actually pretty easy. Whenever you need to update the progress bar from any of the threads, you add the update code to

display.asyncExec(new Runnable() { .... }); 
+2
source

Source: https://habr.com/ru/post/893715/


All Articles