Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Browser Separate Process
SWT Browser Separate Process [message #1391323] Mon, 30 June 2014 19:25 Go to next message
Dennis S is currently offline Dennis SFriend
Messages: 3
Registered: May 2014
Junior Member
I'm using the SWT browser to load up a massive AngularJS application. While the performance of the app can be argued what happens is the browser takes from 2 - 14 seconds to load.

Because the browser operates on the UI thread, the UI completely locks up. Are there any known solutions to say run the browser in a separate process or thread?

I display a message alerting the user that the window may freeze for a moment or two, but on Ubuntu it seems the window manager thinks the process has failed, greys the window out and asks to force quit the application. So, essentially, I can't use my application in Linux.

Any ideas?
Re: SWT Browser Separate Process [message #1392353 is a reply to message #1391323] Wed, 02 July 2014 07:50 Go to previous messageGo to next message
Niraj Modi is currently offline Niraj ModiFriend
Messages: 20
Registered: November 2013
Junior Member
Hi Dennis,
Instead of using a message alerting the user, try displaying busy cursor during long running task, refer below snippet:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130.java

Longer running tasks should be moved to non-UI thread using: Display#asyncExec(Runnable runnable)
Re: SWT Browser Separate Process [message #1392553 is a reply to message #1392353] Wed, 02 July 2014 13:55 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1351
Registered: July 2009
Senior Member
Display.asyncExec does not move long running tasks to a non-UI thread. It allows non-UI threads to update SWT controls. Passing a long running task to asyncExec will lock up your application.
Re: SWT Browser Separate Process [message #1393383 is a reply to message #1392553] Thu, 03 July 2014 18:12 Go to previous message
Dennis S is currently offline Dennis SFriend
Messages: 3
Registered: May 2014
Junior Member
Thank you both of you. I didn't realize that asyncExec would allow SWT controls to update, which is exactly what I was looking for. This has helped me immensely. Thanks to the both of you, this has truly saved a bunch!
Previous Topic:MouseAdapter behaving differently in Mac OS X
Next Topic:Inconsistent table height behavior
Goto Forum:
  


Current Time: Fri Dec 19 04:44:37 GMT 2014

Powered by FUDForum. Page generated in 0.01900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software