Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] AsyncExec() problem ?

On Thu, 2003-10-30 at 18:28, Sylvain Becker wrote:
> 
> //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.
> 			}
> 		}
> });

If I understand things correctly, this Runnable will hijack the GUI
thread. That would be why the GUI wouldn't respond. I'm not sure what
that has to do with the processing of this thread.

If you had:

//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.
                        }
                }
});
while(true) {
	System.out.println("bb");
}

I would expect to see both "aa" and "bb" on the console, but the GUI
would never refresh. Is that what you get when you run it?

Apologies if I didn't understand your question correctly, I'm just
responding to the code presented.

mike

> thanks you for your help,
> 
> 
> --
> Sylvain Becker
-- 
Michael R Head <burner@xxxxxxxxxxx>
ZClipse -- OpenSource Eclipse plugins



Back to the top