SWT: UI freezes while the background thread is executing -
06-08-2009, 06:00 AM
Hi,
I have dialog on which I want to create a thread, that does some task of processing data for long time. My UI needs to update the data based on the progress in the thread. I have some methods that can be called from the thread to update the UI. But the problem is during all this time UI is not responsive though the data reflects on the UI. I tried with IRunnableWithProgress and also Jobs. The disadvantage with a Job is am not able to stop the job once my dialog is closed. And with IRunnableWithProgress the modal information progress dialog blocks my dialog until its done. So, I passed the runnables/threads to the display.asyncExec but the UI is not responsive. I tried to create simple data processing threads but there the issue is I won't be able to stop them properly once the user decides to close the dialog.
So, wish there is something that I can do to make my UI responsive.
Kindly let me know, is there any solution for making the UI responsive while a background thread runs that's been spun off from the UI.