Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!NUSVM.BITNET!GBOPOLY1 From: GBOPOLY1@NUSVM.BITNET (fclim) Newsgroups: comp.sys.apollo Subject: Re: IPC vs SOCKETS Message-ID: <8905150141.AA08887@umix.cc.umich.edu> Date: 15 May 89 01:40:50 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 48 X-Unparsable-Date: Mon, 15 May 89 08:57:56 SST 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.