DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page SWT: UI freezes while the background thread is executing
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Location: Bangalore
Default 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.

Thank you,

Asha.
Reply With Quote
  (#2 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-12-2009, 02:20 AM

Hi, asha

May be it requires two threads, one for the data process, the other one is used for updating UI. (this thread must be UI thread)


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#3 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-12-2009, 02:24 AM

Hi, asha

May be it requires two threads, one for the data process, the other one is used for updating UI. (this thread must be UI thread)


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Background Picture for the Editor field Detschie Java 0 04-24-2009 09:35 AM
Executing jaco from Eclipse Alexandra N Eclipse 0 03-18-2009 06:01 AM
How to change the foreground and background of ToolItem ? MikeLee123 Eclipse 0 02-26-2009 05:10 AM
UI Thread issues in SWT on eclipse 3.0 shnkar007 Eclipse 1 01-27-2009 06:24 AM
keep the main thread alive mitroiasi Java 0 03-13-2008 12:37 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com