home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / softsys / andrew / 1393 < prev    next >
Encoding:
Text File  |  1992-11-23  |  4.4 KB  |  98 lines

  1. Newsgroups: comp.soft-sys.andrew
  2. Path: sparky!uunet!haven.umd.edu!purdue!decwrl!adobe!usenet
  3. From: zstern@adobe.com (Zalman Stern)
  4. Subject: Re: communication between Adew controllers
  5. Message-ID: <1992Nov23.220317.17837@adobe.com>
  6. Sender: usenet@adobe.com (USENET NEWS)
  7. Organization: Adobe Systems Incorporated
  8. References: <1992Nov20.205516.1211@csi.uottawa.ca>
  9. Date: Mon, 23 Nov 1992 22:03:17 GMT
  10. Lines: 86
  11.  
  12. In article <1992Nov20.205516.1211@csi.uottawa.ca>  
  13. isabelle@shamin.genie.uottawa.ca (Isabelle Tourneux) writes:
  14. > First, thank you very much for all the detailed answers you have
  15. > given me concerning message queues. This has however led me to
  16. > other questions :
  17. > I have several adew "view+controller" in the same machine, which
  18. > are spawned successively with forks and execs. I would like to have
  19. > them communicate with each other. So I have looked at all the
  20. > possible means of communication between these controllers. I am
  21. > using System V.
  22.  
  23. Which System V?
  24.  
  25. > - interruptions would be a nice solution, but I have not managed
  26. > to get the pid of the controller without clicking somewhere on the
  27. > view. A getpid() in controller_go gives the pid of runadew I guess.
  28. > Moreover, runadew puts the group id of the controller equal to the
  29. > pid of this controller, so I cannot get the group id of the
  30. > controller without clicking on the view, as for the pid. Is it
  31. > possible to change the code of runadew to prevent it from
  32. > initializing the group id of the controller ? Do you think
  33. > interruptions would work as I am working under System V and Xwindows
  34. > ?
  35. I assume you mean "signals" when you say "interruptions." Depending on the  
  36. version of System V you are using (i.e. you want reliable signals) it might  
  37. be possible to get this to work. My personal philosophy is that signals are  
  38. best used for exceptional conditions and should be avoided for other things.  
  39. Mostly due to the difficulty of debugging asynchronous code, but also due to  
  40. really bad experiences with kernel bugs involving signals.
  41.  
  42. > - I know sockets would be a solution, but I would prefer not to
  43. > use them for internal communication between processes runing on
  44. > the same machine : I am afraid I will not be able to send a huge
  45. > file through a socket without cutting it into smaller parts, and I
  46. > would like to avoid that. Do you think Unix Domain Sockets could
  47. > allow me to send huge file without cutting them ?
  48.  
  49. I have no idea why you claim this is a problem. Both UNIX domain and TCP  
  50. sockets should work fine for this application. This would be my personal  
  51. favorite.
  52.  
  53. > - as all my controllers have got different names, I have thought
  54. > about memorizing the pointers on each controller in a memory shared
  55. > by all the processes :
  56. >  struct controlleri * ptri ( i = 1, 2...),
  57. > and call functions of a controller from another controller, using
  58. > this pointers : controller1_thisFunction(ptr1) in the code of the
  59. > 2nd controller for instance.
  60. > The 1st controller is running, but the function is not called
  61. > successfully, and there is a segmentation fault. Before, I had
  62. > never had problems with memorizing pointers on an ATK view or
  63. > dataobject in another ATK view or dataobject, and calling
  64. > functions with these pointers. Is there something specific to adew
  65. > which prevents from doing that ? 
  66.  
  67. I don't know enough about ADEW to understand this question.
  68.  
  69. >                          I am trying at any rate to establish a
  70. > communication between Adew controllers, but it is hard because adew
  71. > and runadew were not written for that kind of application, but were
  72. > supposed to be used only for prototyping. Anyway I really want to
  73. > find a way of establishing these connections, even if the solution 
  74. > is not the most elegant.
  75.  
  76. I guess my high level answer would be that you want an RPC package to ease  
  77. communication between separate processes. If nothing else some sort of name  
  78. service seems in order. Of course that may be too much work. The simple  
  79. method is to drop a bunch of port numbers into a file all the processes can  
  80. access and use sockets for communication. Be sure to use proper locking  
  81. discipline on the file.
  82.  
  83. > Thanks for your help.
  84. > isabelle Tourneux
  85. > Multimadia Lab of the University of Ottawa.
  86. > isabelle@shamin.genie.uottawa.ca
  87.  
  88. --
  89. Zalman Stern           zalman@adobe.com            (415) 962 3824
  90. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  91.   "Yeah. Ask 'em if they'll upgrade my shifters too." Bill Watterson
  92.