[comp.sys.apollo] IPC vs SOCKETS

GBOPOLY1@NUSVM.BITNET (fclim) (05/15/89)

Hi,
     In article <2005@joshua.athertn.Atherton.COM>, Joshua Levy
(joshua%athertn%pyramid.uucp@lll-lcc.llnl.gov  (Flame Bait)) writes
>I just finished writing some IPC code.  It took me a half day to write
>and a half day to test.  I used neither sockets nor the Apollo stuff,
>but rather UNIX's msgget, msgsnd, msgrcv, and mscgcnt routines.  They
>were exactly what I wanted, and very easy to use.  (I do not use Apollos
>anymore, so I do not know if these routines are part of SR 10.  I'm just
>assuming that since SR 10 is real UNIX, that it includes these routines.
>There is book called "Advanced UNIX Programming" by Marc J. Rochkind
>(Prentice-Hall Software series) which explans how all this works.)
>Joshua Levy

Messages (msg*()), Shared-memory (shm*()), and Semaphores (sem*()) are
part of System V ipc facilities.  These with named pipes (ie FIFO via
mkfifo()) should be bundled with SR10 but users can only use them if
their sys-admin loaded in the System V.

Pipes() may be used for communication between related processes; ie
processes created thro' fork().  Msg*(), shm*(), sem*() and mkfifo()
allows communication between unrelated processes.  However, except for
FIFO, these processes must reside on the same workstation since msgget()
generate a message queue and semget() generate a set of semaphore
variables in the *kernel* and shm*() obviously must share the same memory.
I am not sure about FIFOs.  There is the question of sychroncity between
the producer and consumer processes if they are on different nodes.  Since
the kernel must come in to sychronize these processes, I believe FIFOs
are hard to use in a network.

The book by Maurice Bach, "Design of the Unix Operating System", is a
good place to look into these system calls.

So, we have a sort of hierarchy.  Pipes() may be used only between related
processes.  The other IPC facilities on System V may be used between
unrelated processes in a non-distributed environment.  Finally, BSD socket
may be used in a network.  System V (maybe Release 2 and above) have a
new machanism known as streams.  This works across networks.  I do not
have any info on this except (1) there is an article by Dennis Ritchie
in the July (?) 84 issue of the AT&T Journal -- special issue on UNIX
-- and (2) the Streams Programmer's Guide (?) published by AT&T.

I hope this clears things up.

fclim          --- gbopoly1 % nusvm.bitnet @ cunyvm.cuny.edu
computer centre
singapore polytechnic
dover road
singapore 0513.

weber_w@apollo.COM (Walt Weber) (05/15/89)

In article <8905150141.AA08887@umix.cc.umich.edu> GBOPOLY1@NUSVM.BITNET (fclim) writes:
>The book by Maurice Bach, "Design of the Unix Operating System", is a
>good place to look into these system calls.

We (software support) have given Marc Rochkind's book as a reference, since
it covers SysV FIFO's, semaphores, queues, and shared memory, which many other
books do not address. For your convenience, here's the info you need to order:
"Advanced UNIX Programming", by Marc J. Rochkind ; Prentice-Hall, paperback
ISBN is 0-13-011800-1.

>So, we have a sort of hierarchy.  Pipes() may be used only between related
>processes.  The other IPC facilities on System V may be used between
>unrelated processes in a non-distributed environment.  Finally, BSD socket
>may be used in a network.

Excellent summary!  Now if you include the next level up from the socket
abstraction, you would be addressing the Network Computing System topics
covered in these Apollo manuals (sr9 & sr10):

     - Network Computing System (NCS) Reference        #010200
     - Concurrent Programming Support (CPS) Reference  #010233

(Yes, it is a plug :-)

> ...  System V (maybe Release 2 and above) have a
>new machanism known as streams.  This works across networks.  I do not
>have any info on this except (1) there is an article by Dennis Ritchie
>in the July (?) 84 issue of the AT&T Journal -- special issue on UNIX
>-- and (2) the Streams Programmer's Guide (?) published by AT&T.

You can also acquire the following Apollo documentation which should
include the information available from (2), above.  Keep in mind that
you will need to consider adding a device driver to the system, so I
have included the reference for GPIO programming, as well (sr10):

      - Writing Device Drivers with GPIO Calls     #000959-A00
      - Getting Started with SysV Streams          #012276-A00
      - Programming with SysV Streams              #012275-A00
      - Programming  with the SysV Streams         #012205-A00
          Transport Layer Interface (TLI)

>fclim          --- gbopoly1 % nusvm.bitnet @ cunyvm.cuny.edu

...walt...

-- 
Walt Weber                            Apollo Computer          
(508) 256-6600 x8315                  People's Republic of Massachusetts
-The views expressed herein are personal, and not binding on Apollo-

guy@auspex.COM (Guy Harris) (05/17/89)

Hi, thought others on this group would like to see this.

fclim          --- gbopoly1 % nusvm.bitnet @ cunyvm.cuny.edu
computer centre
singapore polytechnic
dover road
singapore 0513.
----------------------------Original message----------------------------
>System V (maybe Release 2 and above)

No, Release 3 and above.

>have a new machanism known as streams.  This works across networks.

No, streams itself doesn't work across networks.  Streams isn't really
an IPC mechanism in and of itself; it's a framework atop which IPC
mechanisms can be built, some of which (e.g., TCP/IP, ISO protocols,
etc.) work across networks.