Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT syncexec question
SWT syncexec question [message #519401] Mon, 08 March 2010 12:50 Go to next message
Eclipse UserFriend
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 12:51] by Moderator

Re: SWT syncexec question [message #519587 is a reply to message #519401] Tue, 09 March 2010 06:58 Go to previous message
Eclipse UserFriend
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 06:59] by Moderator

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


Current Time: Wed Jul 23 15:11:00 EDT 2025

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

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

Back to the top