Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Display.syncExec() with set priorities?
Display.syncExec() with set priorities? [message #1798681] Thu, 22 November 2018 15:57 Go to next message
afer feri is currently offline afer feriFriend
Messages: 2
Registered: November 2018
Junior Member
Hello, I want to call display.syncExec or asyncexec but I have many methods calling these methods and I wonder if it is possible to set a priority so that if I use a certain method I can prioritize it and make the UI-thread update this first?

thank you thank you
Re: Display.syncExec() with set priorities? [message #1798707 is a reply to message #1798681] Fri, 23 November 2018 05:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
No. You might use an approach of managing this via a single instance of a Runnable:
			class MyManager implements Runnable {
				private boolean dispatched;

				public void run() {
					dispatched = false;
					// Process queued information.
				}

				private void dispatch() {
					if (!dispatched) {
						dispatched = true;
						getControl().getDisplay().asyncExec(this);
					}
				}

				public void queueSomeInformation(...) {
					// Queue up some information to be processed on the UI thread.
					dispatch();
				}
			}
It could accumulate prioritized state to be processed/handled on the UI thread. If there are really multiple threads involved, you'll want to be careful to make it thread safe.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Display.syncExec() with set priorities? [message #1798743 is a reply to message #1798707] Fri, 23 November 2018 12:57 Go to previous message
afer feri is currently offline afer feriFriend
Messages: 2
Registered: November 2018
Junior Member
thanks, i will think about it
Previous Topic:Projects fail to transfer to new computer
Next Topic:uninstall eclipse photon
Goto Forum:
  


Current Time: Thu Apr 25 04:49:35 GMT 2024

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

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

Back to the top