FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

syncExec, and threading.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT
View previous topic :: View next topic  
Author Message
thedracle



Joined: 25 Dec 2005
Posts: 11

PostPosted: Sun Dec 25, 2005 5:29 pm    Post subject: syncExec, and threading. Reply with quote

I'm not sure if this is a bug, but I'm attempting to update the UI from a thread reading input from a socket in the background. It calls a local delegate, that then attempts to update the field with:

class TextAppend : Runnable
{
public void run()
{
printf("Test\n");
text.append(textBuf);
}
}
display.syncExec(new TextAppend());

Unfortunately, it doesn't work. The asyncExec kills my thread, and here is never printed. I haven't been able to get asyncExec to work either. Is there some special way to use this functionality in DWT?

-Jason Thomas.
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Sun Dec 25, 2005 9:30 pm    Post subject: Reply with quote

Poseidon uses this approach to do a background search and display the result in the bottom panel text field. It uses delegate instead of Runnable class but I think they are the same thing. You can refer to the source of Poseidon and check its code.

The description of SWT thread issue is here
http://help.eclipse.org/help30/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/swt_threading.htm
Back to top
View user's profile Send private message
thedracle



Joined: 25 Dec 2005
Posts: 11

PostPosted: Mon Dec 26, 2005 2:43 pm    Post subject: Thanks Reply with quote

Alright, I updated dmd, and got the newest development version of DWT, and everything works. Sorry Smile

-Jason Thomas.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group