home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff290.lzh / IPC / READ_ME < prev    next >
Text File  |  1989-12-11  |  16KB  |  329 lines

  1.  
  2.                Inter-Process Communication Standard
  3.                ====================================
  4.  
  5.                           November 1989
  6.  
  7.  
  8. This package had its origin in several months' discussion during 1988
  9. on usenet.  The goal has been to create a standard for Inter-Process
  10. Communication on the Amiga (briefly known as "IPC") that is flexible enough
  11. to handle the widest possible range of applications.  The basic standard is
  12. now fairly well fixed, though many areas are still undeveloped.
  13.  
  14. Over the past year or so there has been a considerable rise in interest in
  15. IPC in general, and in particular ARexx has become very popular.  The
  16. protocol described here addresses some rather different problem areas from
  17. ARexx, and emphasizes different aspects of the communication process (like
  18. fast communication and data structure).  I believe they both have their
  19. place, and hopefully there will be some integration eventually.  To
  20. distinguish this particular scheme it has become known as "PPIPC" (because
  21. the main authors were Pete (Goodeve) and Peter (da Silva)...).  Better to
  22. keep personalities out of it, though, and think of it as standing for
  23. "Packet Passing IPC", or "Port Protocol IPC", or some such.
  24.  
  25. This standard is completely Public Domain, and it could lead to some
  26. outstanding new capabilities for this machine.  This release is now based
  27. on a shared resident library (occupying well under 2K of memory). The code
  28. needed in an application program to make use of it should also be compact.
  29.  
  30. [I'm afraid that the sources are heavily Lattice oriented, though hooks
  31. have been provided that should make the library, at least, work fine with
  32. Manx/Aztec too.]
  33.  
  34.  
  35.  
  36.                           What is IPC ?
  37.                           =============
  38.  
  39. The idea is to provide an alternative to the monolithic programs that have
  40. become typical of the other personal computers, which don't have built-in
  41. multitasking.  Rather than try to cram all sorts of features into one
  42. loadable program, why not put them in smaller modules which run as separate
  43. processes, and have them coordinate their activities through "Inter-Process
  44. Communication"?  Only those modules needed for the task at hand then have
  45. to be loaded, giving the user much more flexibility.  If the standard is
  46. properly designed, modules from entirely different sources should be able
  47. to talk to one another.
  48.  
  49. The basic concern is to have a message passing mechanism that is both safe
  50. and flexible.  Messages must carry complete identification of their
  51. contents in a standard form so that communication is always clear and
  52. unambiguous.  Because the various communicating modules will start up, and
  53. depart again, asynchronously, the ports through which the messages are
  54. passed have to be managed carefully, so that there is no danger of, for
  55. example, sending a message to a no-longer-existing port.
  56.  
  57. All these goals and concerns are discussed at much more length in
  58. Docs/IPC.Doc.
  59.  
  60. There are demos in this package showing how IPC is intended to operate, but
  61. they aren't perhaps as inspiring as I would like.  For my talk at BADGE on
  62. IPC, I created a much more useful IPC suite, which displayed my "slides" on
  63. the topic.  It comprises five modules working together: a Bitmap display
  64. server, an ILBM (to bitmap) server, a Script Manager that determines which
  65. slides to preload to bitmaps and sends them to the display server as
  66. requested, and two Client programs -- one to accept commands from the
  67. keyboard, and the other from a joystick; actually the display server is a
  68. client as well -- it passes mouse-click generated commands to the Script
  69. manager.  Unfortunately all this isn't really suitable for distribution at
  70. the moment: it all works well, but the pieces were hacked together, rather
  71. than designed, with expedient short-cuts and incosistencies; all in all,
  72. not a shining example of how to do it.  Anyhow, the slides themselves
  73. filled two disks!
  74.  
  75. I have also converted (and slightly extended) Peter da Silva's File
  76. Requester into a Server, but I just haven't had time to put it into
  77. publishable form yet.  Hopefully soon..
  78.  
  79. On the other hand, perhaps I needn't worry too much about the availability
  80. of examples.  Dave Navas used PPIPC as the basis of his magnificent
  81. JazzBench -- find it on Fish Disk #228.  If you haven't come across it yet,
  82. this is a multitasking replacement for WorkBench, meaning amongst many
  83. other things that you don't have to wait until all the icons have loaded
  84. before you can select one. True to the spirit of IPC, too, the user can
  85. choose modules to provide different modes of action, such as fancy window
  86. opening and closing, or different "beeps".  In its current "alpha" version,
  87. there are no published IPC hooks for others to hook into JazzBench, but no
  88. doubt these will show up if Dave gets any respite from his studies...
  89.  
  90. I'm also a little appalled at the volume of verbiage that seems needed to
  91. put over the concepts.  I guess the trouble is that it's less a program,
  92. more a philosophy.  It certainly seems to require some evangelism, anyhow.
  93. I've tried to organize the material so that it won't be too hard to plow
  94. through.  I hope a few people will get inspired to try approaching some of
  95. their programming this way.
  96.  
  97.  
  98.                         What's in the package
  99.                         =====================
  100.  
  101. Here you will find an icon to install ppipc.library in your 'LIBS:'
  102. directory, a couple of trivial demos of the concept, and various
  103. directories containing documentation and sources for nearly everything.
  104.  
  105. [The significance of the icons used may be obscure to people who weren't
  106. at the BADGE meeting on IPC last year.  ...just think of Servers, Clients,
  107. and Managers...]
  108.  
  109.  
  110. Install_Library --  An "Xicon capsule" that installs "ppipc.library"
  111.                     in the current LIBS: directory, as required before
  112.                     any program using IPC can run.  (As with IPC_Demo,
  113.                     below, it is actually a directory containing
  114.                     ppipc.library and suitable text and script.)
  115.  
  116.  
  117. Small_Demo      --  A very simple demo of a client and a server communicating
  118.                     via IPC.  It has no useful function at all.
  119.  
  120.                     (Before trying to run it, you must have executed the
  121.                     "Install_Library" icon -- see above.)
  122.  
  123.                     Clicking on the icon starts a Server that just sends
  124.                     the text of messages it receives to standard output
  125.                     (redirected here to a console window), and a Client
  126.                     that accepts typed input and sends each line as a
  127.                     message to the Server.  The IPCPort through which the
  128.                     messages pass is named "Demo".  When you exit the
  129.                     client by typing an EOF char ('ctrl-\'), another little
  130.                     "Client" called "Quit" is invoked to tell the Server
  131.                     also to terminate.
  132.  
  133.                     Explore it together with the associated sources on the
  134.                     disk. The demo uses an Xicon script to start up the
  135.                     Server and Client processes.  Note that IPC_Demo itself
  136.                     is actually a directory containing all the necessary
  137.                     files (except Xicon, which should be in the C directory
  138.                     of this suite).
  139.  
  140.  
  141. IPC_Demo        --  A less simple demo of a client and a server using
  142.                     IPC.  It  also has no useful function  (aside from
  143.                     illustration), though the Print Formatting Server
  144.                     should be generally useful.
  145.  
  146.                     The Server here is one that performs numeric-to-text
  147.                     and other formatting of message items it is sent; a
  148.                     snmgle message can contain items of different types,
  149.                     such as integers, floating point values, strings, and
  150.                     (printf style) formatting strings, all of which will
  151.                     be combined into a single output string.  Depending on
  152.                     other instructions in the message, the output may be
  153.                     sent to the output of the server, to a specified
  154.                     handle, or returned as an item when the message is
  155.                     replied.
  156.  
  157.                     The Client just puts a bunch of items (which the user
  158.                     has no control over...) into a message and sends it off
  159.                     for formatting; you can, however, select by keyboard
  160.                     command whether the output goes to the Server Window,
  161.                     to the Client window (via file handle), or is returned
  162.                     in the message.  Rather than using a "Quit" client as
  163.                     the previous demo does, the Client itself sends the
  164.                     QUIT message as it terminates.
  165.  
  166.                     The comments on the previous demo also apply here.
  167.  
  168.  
  169. Broker          --  A demonstration of the "Port Broker" concept.  See the
  170.                     READ_ME file in the drawer for more information.  The
  171.                     directory also contains a "Cleaner" utility (no icon).
  172.  
  173.  
  174. Docs            --  Documents on the IPC protocol:
  175.  
  176.      IPC.doc            --  A description of the IPC concept and this
  177.                             standard.
  178.      Standard Flags     --  An extended description of the IPCMessage flags
  179.                             in IPC.h.
  180.      Standard IDs       --  The currently defined and reserved IPC Message
  181.                             and Item IDs.
  182.  
  183.  
  184. IPC_Include     --  The Main header file (IPC.h) required for applications
  185.                     using IPC, the direct library call header for recent
  186.                     Lattice compilers, and other files that may be of
  187.                     general use for compilation or assembly.
  188.  
  189.  
  190. Sources         --  A directory containing source files for the demo
  191.                     program modules, plus those for the Port Broker and
  192.                     "Cleaner" utility.  See the READ_ME file in the
  193.                     directory.
  194.  
  195.  
  196. IPC_Lib_Sources --  A directory containing the source files for the IPC
  197.                     library routines.  See the READ_ME file in the directory
  198.                     for contents and details.
  199.  
  200.  
  201. Lattice_link_lib    -- The library call stubs required by earlier versions
  202.                     of Lattice for linking. (Also see Libraries.)
  203.  
  204.  
  205. Manx_link_lib    -- Trivially modified versions of the Lattice linkage
  206.                     stubs that sould be suitable for assembly under Aztec.
  207.                     An object file (ipc.lib) for Manx 3.4 is included.
  208.  
  209.  
  210.  
  211. Libraries       --  (Another) copy of ppipc.library, and the (Lattice
  212.                     version) linkage routines needed by compilers previous
  213.                     to 4.0. (IPC.lib)
  214.  
  215.  
  216.  C              --  utility programs (Xicon and Most).
  217.  
  218.  
  219.                                 %%%%%%%%%%%%%
  220.  
  221.  
  222. Brief Notes on usage:
  223.  
  224.     The PPIPC scheme is both a protocol and a Shared Resident Library,
  225.     designed to make (direct) communication between independently written
  226.     programs easier to manage.
  227.  
  228.     The protocol defines (in an open ended fashion) the structure of
  229.     messages to be passed between programs, in a manner that allows any
  230.     "Server" program that is capable of handling a particular message to
  231.     recognize that message and process it appropriately; when the message
  232.     is replied to the originating "Client", this program can in turn
  233.     determine (from flags in the message) what changes have been made.
  234.     The Library handles message passing much more securely than Exec does,
  235.     so that, for example, a message cannot be sent to a no-longer-existing
  236.     port.  It also provides other utilities, such as creation and deletion
  237.     of standard IPC messages.  IPCMessages are basically Amiga Exec messages
  238.     with a specific structure -- comprising an ID and zero or more items
  239.     --appended to the basic message block.  This is all described in much
  240.     more detail in IPC.Doc and the other files in Docs.
  241.  
  242.     There is at least one other semi-standard piece to the protocol -- the
  243.     "Port Broker".  One of the standard calls to the library (LoadIPCPort)
  244.     triggers a call to this Broker process (when one is installed) if a
  245.     port with the requested name is not found; it is then up to the Broker
  246.     to load a Server for this port (presumably by consulting some
  247.     configuration file).  Only a primitive such broker exists so far
  248.     (see Other_Sources); if you feel inspired to improve it, please go
  249.     ahead.  One of the main tenets of IPC is that only the core should be
  250.     fixed: people should be able to mix 'n match everything else.
  251.  
  252.  
  253.     The Library is a standard disk-resident shared library, which of course
  254.     must be installed in LIBS: before IPC can be used.  The way you call the
  255.     library from any program you write will depend on the compiler you are
  256.     using.  Like any other resident library, calls to it are made via offset
  257.     jump vectors in the library node, and it must receive the parameters of
  258.     the call in appropriate registers (see IPC_lib.fd in IPC_Include for
  259.     the actual registers each call uses).  Most compilers require that you
  260.     include an object library at link time, containing short stub routines
  261.     to turn high-level language calls into jumps with the appropriate
  262.     registers set.
  263.  
  264.     Unfortunately I only have access to Lattice C, so that this is the only
  265.     interface immediately available.  It is provided in two forms: for
  266.     Lattice versions 4.0 or later, you can simply include IPC_proto.h (in
  267.     addition to IPC.h, which is always required) when you compile, and
  268.     calls will be generated in a suitable form automatically; for earlier
  269.     versions, you will have to link with IPC.lib (found in Libraries and
  270.     Lattice_link_lib).
  271.  
  272.     Assembly sources have been provided to create a Manx/Aztec library,
  273.     and an object file for Manx 3.4.  If you want 3.6 compatibility I'm
  274.     afraid you'll have to do this yourself. If you feel tempted to generate
  275.     linkages for other languages such as Modula-2, that would be great.
  276.  
  277.     Whatever compiler you use, you must of course do
  278.  
  279.         IPCBase = OpenLibrary("ppipc.library",2);
  280.  
  281.     before you use the library, and CloseLibrary(..) at the end.  (And the
  282.     library pointer MUST be named IPCBase' if you intend to use any of the
  283.     provided access mechanisms).
  284.  
  285.     I hope that's enough to get you started.  The main sources of
  286.     information at the moment, as well as the Docs files, are the header
  287.     file IPC.h, the demo sources, and the Library sources themselves. Have
  288.     fun!
  289.  
  290.                                 %%%%%%%%%%%%%
  291.  
  292.  
  293. Acknowledgments and attributions:
  294.  
  295. This package and its contents were compiled by Pete Goodeve, who should be
  296. flamed... er.. blamed... for all its inadequacies.  Almost all the code
  297. here was also written by Pete.
  298.  
  299. The IPCMessage format was largely the design of Peter da Silva.
  300.  
  301. The mechanism used to manage IPCPorts safely ("use counts") was originally
  302. suggested by Matt Dillon.
  303.  
  304. The additions to IPC.h needed to make it compatible with Manx C
  305. were supplied by Brian Witt.  Dave Navas supplied the Manx linkage
  306. library.
  307.  
  308. Special acknowledgment must also go to Dave Navas for his amazing JazzBench,
  309. which aside from being a great piece of work in its own right is a perfect
  310. example of the possibilities of IPC.
  311.  
  312. Essential criticism and suggestions have come from Stuart Ferguson, Ron
  313. Minnich, Chuck McManis, Leo Schwab, Dave Navas, and many other denizens of
  314. the net. I know I've omitted some names I shouldn't have, but a lot of
  315. messages (of the net variety) flowed during the hectic early months.  Much
  316. appreciation is due to all who have taken the trouble to read, consider,
  317. and contribute to the mass of material that has accumulated. Thank you all!
  318.  
  319.                                                 Pete Goodeve
  320.                                                 3012 Deakin Street #D
  321.                                                 Berkeley, Calif. 94705
  322.  
  323.                                                 [pete@violet.berkeley.edu]
  324.                                                 [...ucbvax!violet!pete]
  325.  
  326.  
  327.                                 %%%%%%%%%%%%%
  328.  
  329.