Concurrency problem in building TreeItem [message #460652] |
Fri, 02 September 2005 07:43  |
Eclipse User |
|
|
|
Originally posted by: murley.murley.murley
Hello, i have a question about concurrency in my gui application.
Left hand side have a many tree item, when select one of the tree item, the
right hand side will create about 50000 numbers of Tree Item.
But when creating the 50000 numbers of tree Item, the gui application become
un-responsive.
Here is my code for concurrency issue...
Thread t = new Thread(){
public void run(){
shell.getDisplay().asyncExec(new Runnable(){
public void run(){
TreeItem item = new TreeItem(tree, SWT.NONE);
item.setText("item " + i);
}
});
}
};
t.start();
is that i have something wrong?
thanks for help
|
|
|
|
|
|
Re: updated code.. [message #460745 is a reply to message #460653] |
Tue, 06 September 2005 12:25  |
Eclipse User |
|
|
|
Your updated code gives me reasonable performance while the Tree is
populating (win32), though this does take a while to finish.
The good news is that VIRTUAL is planned to become a supported style on Tree
for 3.2M2 (see
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/R3_2/plan.html )
, so you'll soon be able to just create items on an as-needed basis like in
Table.
Grant
"murley" <murley@murley.murley> wrote in message
news:df9e4h$cr1$1@news.eclipse.org...
> i have update the code like this...
>
> Thread t = new Thread(){
> public void run(){
>
> for (int i = 0; i < 50000; i++){
> shell.getDisplay().asyncExec(new Runnable(){
> public void run(){
> TreeItem item = new TreeItem(tree, SWT.NONE);
> item.setText("item " + i);
> }
> });
> }
> }
> };
> t.start();
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.25287 seconds