thread-safe "pixmap-server"



I have a program which opens multiple windows 
that perform some heavy-duty seismic data 
visualization. To construct an image,  a whole lot 
of external data access and computation is 
required. A user will thus typically work on a handful 
of such windows  "in parallel". It is therefore 
necessary to construct the images  in a separate 
thread, a "pixmap-server" (using pthread_create()), 
and signal to the respective window that its pixmap 
has been completed and needs to be displayed. 
It is (perhaps optimistically?) postulated that a fair bit 
of computation and  i/o will overlap and two images 
created in parallel will take much less time than the 
same images created sequentially.

Now the GTK+ FAQ (5.2) states that GLib is not 
thread safe, and  must be initialized with g_thread_init(), 
and the gtk_main() must  be sandwiched between 
gdk_threads_enter() and ...leave(). This, as far as I 
understand, means that all calls to GLib functions
are internally locked to execute one at a time.

Given all this, is it reasonable to expect that multiple 
images which require lots of computation, i/o and gdk 
(but not gtk) calls would be created in parallel? Or should 
the pixmap-server function use some other graphical 
library which is thread safe.  Is there such a thing?

Your comments and suggestions are welcome. 
Thanks in advance.

tk
Anthony K. Transportation Systems - no HTML mail please. 




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