[comp.unix.i386] Shared Mem, Msg queues, Semaphores Code fragments wanted

dave@norsat.UUCP (Dave Binette) (07/28/89)

An upcoming project requires some efficient interprocess communications
to be developed using XENIX 386's V2.3.1

Since my working knowledge of IPC's is a small subset of total ignorance,
I could really use (and appreciate) code fragments incorporating any of
the following:
msgctl(S)   msgget(S)   msgop(S)
semctl(S)   semget(S)   semop(S)
shmctl(S)   shmget(S)   shmop(S)
ipcs(C)     ipcrm(C)

Exercises and "just-playing-around-with" type code would be wonderfull.
Formally correct code would be ideal.

Dont be shy about "sloppy" code though, its just between You and Me, and
I'll rework anything I receive to suit my own twisted idea of apropos'

If there is interest in this project i'll be happy to post a set of
commented exercises using some or all of these functions as a result
of my learning process.

--
uucp:  {uunet,ubc-cs}!van-bc!norsat!dave | 302-12886 78th Ave
bbs:   (604)597-4361     24/12/PEP/3     | Surrey BC CANADA
voice: (604)597-6298     (Dave Binette)  | V3W 8E7

patrick@scrooge.ism.isc.com (Patrick Curran) (08/01/89)

In article <100@norsat.UUCP> dave@norsat.UUCP (Dave Binette) writes:
>An upcoming project requires some efficient interprocess communications
>to be developed using XENIX 386's V2.3.1
>
>Since my working knowledge of IPC's is a small subset of total ignorance,
>I could really use (and appreciate) code fragments incorporating any of
>the following:
>msgctl(S)   msgget(S)   msgop(S)
>semctl(S)   semget(S)   semop(S)
>shmctl(S)   shmget(S)   shmop(S)
>ipcs(C)     ipcrm(C)
>

The "AT&T UNIX System V/386 Programmer's Guide" has a whole chapter on
IPCs.  This includes full listings of test programs that exercise all
aspects of the IPC system calls.  I haven't tried them, but they look
pretty good.  I think you'll find them a great help.

Of course, XENIX is not UNIX...

Patrick Curran (patrick@ism780c.isc.com)
(uunet!ism780c!patrick)
INTERACTIVE Systems Corp, Santa Monica, CA. (213) 453-8649

todd@stiatl.UUCP (Todd Merriman) (08/01/89)

>I could really use (and appreciate) code fragments incorporating any of
>the following: >msgctl(S)   msgget(S)   msgop(S)
>semctl(S)   semget(S)   semop(S) >shmctl(S)   shmget(S)   shmop(S)
>ipcs(C)     ipcrm(C)

"Advanced Unix Programming"
by Marc J. Rochkind
Prentice-Hall, Inc.
Englewood Cliffs, NJ 07632

   ...!gatech!stiatl!todd
   Todd Merriman * 404-377-TOFU * Atlanta, GA

guy@auspex.auspex.com (Guy Harris) (08/02/89)

(This is generic UNIX stuff - generic, at least, to systems that have
picked up S5 IPC - so we move it here to "comp.unix.questions"....)

 >The "AT&T UNIX System V/386 Programmer's Guide" has a whole chapter on
 >IPCs.  This includes full listings of test programs that exercise all
 >aspects of the IPC system calls.  I haven't tried them, but they look
 >pretty good.  I think you'll find them a great help.
 >
 >Of course, XENIX is not UNIX...

Yes, but it's derived from UNIX, and I'd expect that whoever put S5 IPC
into it probably used as much of AT&T's code as possible.  The vendors
of XENIX System V may even claim SVID compliance for that part of the
system....

steinar@fdmetd.uucp (Steinar Overbeck Cook) (08/02/89)

I suggest you read the book "Advanced UNIX Programming" by Marc J.  Rochkind.
It explains IPC very good, and contains some sample programs which
utilises shared memory, semaphores and message queues.

-- 
Steinar Overbeck Cook, Fellesdata a.s, P.O. Box 248, 0212 OSLO 2, NORWAY
Phone : +47 2 52 80 80                            Fax   : +47 2 52 85 10
E-mail : ...!mcvax!ndosl!fdmetd!steinar  or       steinar@fdmetd.uucp
<The opinions expressed, if any, do not represent Fellesdata a.s>