[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [platform-swt-dev] AsyncExec() problem ?
|
Yes it
seems that it s in only a funcion call. that s why the the "infinite loop"
stuck.
for
me, this behaviour should be ok for "syncExec"
but
the doc say for AsyncExec:
"The caller
of this method continues to run in parallel"
which can be
bad interpreted.
--
Sylvain
Becker
It's not a bug. The runnable is queued in for the user interface
to execute. If you do a "while (true) ..." in the runnable, then the
user interface will be stuck endlessly running your loop, regarless of whether
the runnable was async'd or sync'd. The key here is that async and sync
exec do not create a thread.
BTW:
Investigate Display.timerExec() instead of forking a thread that
periodically executes code in the user interface thread.
| "Sylvain Becker"
<sybecker@xxxxxxxx> Sent by: platform-swt-dev-admin@xxxxxxxxxxx
10/30/2003 06:28 PM Please respond to platform-swt-dev
| To:
<platform-swt-dev@xxxxxxxxxxx> cc:
Subject: [platform-swt-dev]
AsyncExec() problem ? |
Hi all,
I post here because I have some problems using the
asyncExec() function of
the Display Class. And even after looking for many
example, I think there
could be a problem with the function it
self.
documentation says:
"Causes the run() method of the
runnable to be invoked by the user-interface
thread at the next reasonable
opportunity. The caller of this method
continues to run in parallel, and is
not notified when the runnable has
completed."
but if I use
something like this. the thread is called but is always on the
Top, so the
GUI is updated, but never get the focus!! the problem is
"caller of
this method continues to run in parallel". in fact AsyncExec
seems to works
like the "syncExec" function.
//set a thread to update the
gui.
display.asyncExec( new Runnable() {
public void run() {
while(true)
{
System.out.println("aa");
//here, stuff to update
the gui.
}
}
});
thanks you for your help,
--
Sylvain
Becker
_______________________________________________
platform-swt-dev
mailing
list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev