home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / openloo / 4454 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.2 KB  |  47 lines

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