thread-safe "pixmap-server"
- From: "Tony K." <tony kwok 3web net>
- To: gtk-app-devel-list gnome org
- Subject: thread-safe "pixmap-server"
- Date: Wed, 05 Sep 2001 10:15:28 -0600
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]