Re: XForms: Pixmaps need callbacks ?

Steve Lamont (spl@szechuan.ucsd.edu)
Sun, 17 Aug 97 13:10:49 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> You see I have 2 forms up, one controlling the cd-rom, the other
> attempting to show the time code (frames, minutes and seconds). The cd-rom
> part forks and updates the time code using a pointer to the time code
> class from the forked cd-rom routine. Hence upon forking there are
> duplicate time code pointers (this should pose no problem), however there
> must be duplicate form library functions in memory or something !!

Are you making XForms calls from the fork()ed code? This is the Kiss
Of Death[tm]. Only one thread can talk to the X server -- the others
must *absolutely* not do so. As I have mentioned numerous times, X
and therefore XForms is not, in the general case, multithreaded.
There are multithread extensions in X11R6 and later releases but
they're kind of gnarly to use.

If you do a simple fork() basically you have two copies of the
executable running with their own stacks and other contexts but
duplicate file descriptors and several other bits and pieces of
miscellany that are detailed at length in the fork() man page. You
will, indeed, have another instantiation of all the XForms and
underlaying Xlib library routines and either process can attempt to
communicate with the server. This is where the mysterious async
replies come in. One copy of Xlib will send a message of some sort to
the server and another may get the reply.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/