Frequent GUI updates inefficient ? [message #172592] |
Tue, 11 July 2006 18:59 |
Eclipse User |
|
|
|
Originally posted by: vaibhavchopda.yahoo.com
Hi all
I am writing a view in eclipse which displays a model running in another
thread. I used Display.getDefault().asyncExec() to update the view display
when the model changes, which spawns a new thread to update the GUI. I
belive that this will spawn a new thread everytime the model changes and
wants to update the GUI. I belive this is a high overhead if the model
changes frequently.
1. Is the problem I point out really correct ?
2. If it is, is there any other and efficient way to update the GUI view ?
Thanks for answering !
With Regards
Vaibhav
|
|
|
Re: Frequent GUI updates inefficient ? [message #172754 is a reply to message #172592] |
Wed, 12 July 2006 20:32 |
Eclipse User |
|
|
|
Originally posted by: mikhailkhod.rogers.com
The most of the debug perspective views are provided by the Eclipse
platform, not CDT. So, the better place to ask questions like this is the
"platform-debug-dev" mailing list. But I would suggest to check the
discussions posted to the "dsdp-dd-dev" mailing list and presentations at
various DSDP debuggger meetings first.
"vaibhav" <vaibhavchopda@yahoo.com> wrote in message
news:7ca4a34359abeec10f13db123f04202d$1@www.eclipse.org...
> Hi all
> I am writing a view in eclipse which displays a model running in another
> thread. I used Display.getDefault().asyncExec() to update the view display
> when the model changes, which spawns a new thread to update the GUI. I
> belive that this will spawn a new thread everytime the model changes and
> wants to update the GUI. I belive this is a high overhead if the model
> changes frequently.
> 1. Is the problem I point out really correct ? 2. If it is, is there any
> other and efficient way to update the GUI view ?
>
> Thanks for answering ! With Regards
> Vaibhav
>
>
|
|
|
Re: Frequent GUI updates inefficient ? [message #172786 is a reply to message #172592] |
Thu, 13 July 2006 00:32 |
Eclipse User |
|
|
|
Originally posted by: wegener.cboenospam.com
vaibhav wrote:
> Hi all
> I am writing a view in eclipse which displays a model running in another
> thread. I used Display.getDefault().asyncExec() to update the view
> display when the model changes, which spawns a new thread to update the
> GUI. I belive that this will spawn a new thread everytime the model
> changes and wants to update the GUI. I belive this is a high overhead if
> the model changes frequently.
> 1. Is the problem I point out really correct ? 2. If it is, is there any
> other and efficient way to update the GUI view ?
>
> Thanks for answering ! With Regards
> Vaibhav
>
>
The asyncExec call does not create a new thread, it queues the runnable
that you pass into the asyncExec call on the GUI event queue. There is
a single GUI thread that processes all GUI events. You don't need to
worry about flooding the system with threads.
You could still have performance problems however. If you place
runnables on the GUI event queue faster than the GUI thread can remove
them your application will become un-responsive to user input (you will
also have high CPU usage). The rate you application can handle depends
on how much work each runnable is doing and how fast your computer is.
However, you should probably be able to handle thousands of updates per
second.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02803 seconds