pthreads + gtk



I am working on a program that gets data from a socket asynchronously.  As a 
result, the only way I could figure out to update the display as data came in 
was to use pthreads.

I'm using a clist, and the update isn't immediate, sometimes it takes several 
seconds to see the data update onto the screen.  Other times, elements become 
invisible for some time, although the data is there, just not visible.

I figure there is 2 possibilities:

The one I hope it is:

1) I have some experience with X11 coding, and it looks like I need to send 
the GTK equivalent of XSync, but I cannot find it in the documentation.

The one I'm praying it isn't:

2) GTK isn't compatible with pthreads.  I know X11 isn't re-entrant.  If GTK 
can't handle asynchronous input, how should I handle asynchronous data input?  
I *could* cache the data in one thread, and then cause an "event" in the 
gtk_main () loop to cause the data to be processed..  How do I send an event 
from one process to another?

Many thanks,
-Rich



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]