[comp.sys.amiga] UNIX IPC

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (05/17/89)

:True, it only works for interprocess communications on the same machine.  Though
:most of the filesystem based IPCs used in systems like UNIX are completely 
:inadequate for real-time systems.  Depends on what you're building the machine
:to do.  Which is perhaps why most operating systems are adding, if they haven't
:already, multiple forms of IPC.

	Actually, the file-descriptor method as the only communications method
is turning out to work quite well when you combine it with the relatively
new mmap(2) UNIX call to map parts of files into sharable VM.

	The advantage is that the descriptor is well defined and can be used
as a resource in these situations.  For example, UNIX-domain sockets are 
access-controled via the filesystem thus providing an IPC mechanism which 
makes use of filesystem permissions, ownership, etc... Using mmap() or shm*()
calls allow for shared memory under the same security system... the filesytem.

	The only thing that UNIX lacks is a *fast* locking system.  With
shared memory, gaining a lock is now almost instantanious... you simply run
a test-and-set instruction on some shared memory.  The problem is when the
process needs to block... currently the UNIX sigpause()/kill() calls are the
only way to do it right.  (The AT&T sem*() calls are not any better at this).

	There are now things creeping into UNIX like lightweight processes
and other junk.  Sun OS4.0 tries to implement a lot of this stuff but fails
miserably (i.e. their implementations are ugly slow!).  Sun OS3.*'s semaphore
calls are also badly implemented... one has system call overhead on every
semaphore operation whether it needs to block or not!  In fact, so far the
only UNIX I've seen that has a nice efficient implemnentation of most of the
new features available is the sequent Dynix.  (I admit I am only exposed to
four or five real UNIX OS's).

	Really people, we should keep up with the UNIX world, it progresses
too and while the Amiga has learned much from UNIX, it still has a lot more
to learn.

					-Matt