From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114387,b1081e1ca22e9fe4,start X-Google-Attributes: gid114387,public X-Google-Thread: fee84,b1081e1ca22e9fe4,start X-Google-Attributes: gidfee84,public X-Google-Thread: 11035d,b1081e1ca22e9fe4,start X-Google-Attributes: gid11035d,public From: Jean-Claude Magras Subject: Offering Help with sockets, messages and other IPC Date: 1997/05/08 Message-ID: <33718FDA.2EF9@texas.net>#1/1 X-Deja-AN: 240164504 Organization: Texas Networking, Inc. Newsgroups: comp.unix.solaris,comp.unix.programming,comp.unix.osf.osf1 Greetings fellow UNIX programmers, I am working on a C++ class regarding IPC and devised the appended table. I found the attach HTML page which I crated to be useful. You may want to take out the border=2 clause for compatibility with your browser. I retain copyright but you may change/redistribute it freely as long as the copyright is maintained. Enjoy, J.C. Magras <h2> Semantic differences between IPC methods </h2>
Name Primary Descriptor close uses Primary Descriptor? fixed ends? blocks i/o? data handle vs close descriptor
Unix Domain integer yes yes yes seperate
Files ofstream+ifstream yes yes yes seperate
Internet Sockets integer yes yes yes seperate
Shared Memory integer two step:integer+void* no-unstructured no *SAME*
Mapped File integer+void* no--void* no-unstructured no *SAME*
Message Queue integer yes no-sends to last user yes seperate
Semaphores integer yes multicast yes seperate

Only counting semaphores hold any user data and vary little at that. Semaphores are mostly just signals. Shared Memory/Mapped Files offer no data pool access serialization whatsoever. All but sockets need file type access rights which are controlled by ioctl(files) or semctl,shmctl or msgctl. The mapped file must be opened with open() (created if necessary) and retains its contents even after reboot (as do Unix Domain sockets).. a security hazard. The descriptor is then closed and further manipulations are thru the address of its own data pool pointer. Shared memory segments need to call shmat() and shmdt().

SEE ALSO

mmap(2),munmap(2),shmat(2),shmdt(2),shmget(2),semget(2),msgget(2),semop(2),bind(3N), socket(3N),accept(3N),getsockname(3N),select(3C),open(2),close(2),truss(1)

NOTES

truss is an excellent system call loging device for catching ipc errors unfortunately, it is only available on Solaris.

References

Stevens, W. Richard, Unix Network Programming,Prentice Hall, ISBN 0-13-949876-1 Curry, David A.,Unix Systems Programming for SVR4, O'Reilly, ISBN 1-565592-163-1

-- Unix Software Engineer looking for C++/UNIX/Motif/Perl/Tk/Flex Software Engineering position **NOW**. Currently in Austin at (512) 672-5778/magrasjc@texas.net. have Answering machine.