Re: XForms: Forking a child (again)

Tristan Savatier (tristan@bok.net)
Fri, 29 May 1998 12:12:58 -0700

# To subscribers of the xforms list from Tristan Savatier <tristan@bok.net> :

Marco Haverkate wrote:
>
> # To subscribers of the xforms list from Marco Haverkate <marco@xirion.nl> :
>
> Hye there.
>
> There previously has been a discussion about forking a child using Xforms.
> I'm trying to get that to work as well. I've looked in my archives, and found
> the talk about the mpeg/tv solution. I'mn doing the same thing:
>
> pipe();fork(), dup(), etc.
> The child starts up '/usr/sbin/sar', and parent has to read output from child
> to make plots etc.
>
> Now Steve mentioned something about the 'horrible async error', but what's that
> exactly?
> Whenever my program forks, at every X-event I get an error like:
> Xlib: Reply sequence number (0x2e9)
> exceeds request sequence number(0x2e8)
> in reply type 0x1!
>
> And I mean every! (motion/press/release/enter/leave)
> Steve also said to
> "Yes, if you confine the interaction between the program and XForms to
> only one process -- multiple processes trying to talk to the server
> over the same descriptor will cause the dreaded "Xlib async error"."
>
> How to confine this?
>
> Bye, Marco

You should fork/execvp BEFORE opening any X connection
(including initializing Xforms).

If you do that, both processes will use different file
descriptors to talk with X and you will have no such
problem.

-t
_________________________________________________
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/