Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT syncexec question
SWT syncexec question [message #519401] Mon, 08 March 2010 17:50 Go to next message
Robert Langdon is currently offline Robert LangdonFriend
Messages: 2
Registered: March 2010
Junior Member
Hi to all,

I read javadoc for syncExec, asyncExec and readAndDispatch and other documentation:

if I call syncExec(new Runnable() { ... }), I understand that

1. the calling method is blocked until run() method of runnable interface was called by UI Thread;
2. I don't know when syncExec, depend of display dispatch;

But I don't understand a thing: when syncExec was called, it block other syncExec/asyncExec, or may be an interleaving execution of syncExec?

Thanks.

[Updated on: Mon, 08 March 2010 17:51]

Report message to a moderator

Re: SWT syncexec question [message #519587 is a reply to message #519401] Tue, 09 March 2010 11:58 Go to previous message
Robert Langdon is currently offline Robert LangdonFriend
Messages: 2
Registered: March 2010
Junior Member
Hi to all,

I have found response to my question, and reply here the source link: http://www.eclipsezone.com/eclipse/forums/m92013437.html

I report small part of that forum topic:

If your runnable is running on the UI thread (which it would be it is
the subject of a syncExec) then unless you do something to cause the
message queue to be processed then there will not be any interrupts to
your processing. An example of you causing something to process the
message queue would be if you opened a dialog in modal mode. Or if you
did a display.readAndDispatch.

However be aware that since you are blocking the UI thread that unless
your runnable is quick it will be blocking the display for the user. So
your syncExec should do what it needs to do real fast and return so that
the message queue can be processed and not blocked.

Thanks to all. Bye.

[Updated on: Tue, 09 March 2010 11:59]

Report message to a moderator

Previous Topic:How to prevent tree node from collapse
Next Topic:Canvas and FocusListener
Goto Forum:
  


Current Time: Thu Dec 05 17:16:10 GMT 2019

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

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

Back to the top