home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.open-look
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!purdue!news.cs.indiana.edu!lynx!zia.aoc.nrao.edu!laphroaig!cflatter
- From: cflatter@nrao.edu (Chris Flatters)
- Subject: Re: XView PRogramming: Access objects within ch
- Message-ID: <1992Nov11.162139.3892@zia.aoc.nrao.edu>
- Sender: news@zia.aoc.nrao.edu
- Reply-To: cflatter@nrao.edu
- Organization: NRAO
- References: <1992Nov10.234113.29281@cunews.carleton.ca>
- Date: Wed, 11 Nov 92 16:21:39 GMT
- Lines: 34
-
- In article 29281@cunews.carleton.ca, ebx@scs.carleton.ca (edmond bo xiao) writes:
- >Does anybody have experience with accessing XView objects within a forked
- >process? Say, if I want to monitor an input and send all/any to an XView
- >tty or so. I fork a child after all object creations. Everything works
- >fine except I can't write within the child. The call returns correctly but
- >nothing happens to the tty. I even tried shared memory but still didn't
- >get it.
-
- You may be in trouble with X itself. After forking both the parent and the
- child process share a connection to the X server but if more than one of the
- processes generates protocol events there will be trouble. This was dealt
- with in a posting from "der Mouse" that was reproduced in the Summer 1992
- edition of The X Resource (p48).
-
- One problem is that X protocol messages are buffered and written to the server
- in chunks that do not necessarily correspond to message boundaries. It is
- therefore possible for one process to dump its message buffer are the other
- has written an incomplete message to the server. This will upset the server,
- which will see a message that contains trash at the point that the packet from
- the first process ends and the second begins, and may cause it to crash.
-
- In addition, unless you do some hairy messing around, the two process will
- generate messages with duplicate serial numbers. This will also confuse the
- server.
-
- In this case the easiest way to handle the situation is to forward messages
- from the child through the parent process. In other words the parent process
- will communicate with the server and with the child: the child will only
- communicate with the parent.
-
- Chris Flatters
- cflatter@nrao.edu
-
-
-