From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,81d287ff70e6701b X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,81d287ff70e6701b X-Google-Attributes: gidfee84,public X-Google-Thread: 10b612,81d287ff70e6701b X-Google-Attributes: gid10b612,public X-Google-Thread: 10650a,81d287ff70e6701b X-Google-Attributes: gid10650a,public X-Google-Thread: 115614,81d287ff70e6701b X-Google-Attributes: gid115614,public X-Google-Thread: 104fad,81d287ff70e6701b X-Google-Attributes: gid104fad,public X-Google-Thread: 11035d,81d287ff70e6701b X-Google-Attributes: gid11035d,public From: Keith Shortridge Subject: Re: System V IPC, [2] Date: 1996/04/29 Message-ID: #1/1 X-Deja-AN: 152390179 sender: usenet@rp.CSIRO.AU (Network news) x-nntp-posting-host: aaoeppu13.aao.gov.au references: <317C8971.313DF2B2@bis.co.il> <4ljgpn$nr@cucumber.demon.co.uk> content-type: text/plain; charset=us-ascii organization: CSIRO Division of Radiophysics/Australia Telescope National Facility x-url: news:4ljgpn$nr@cucumber.demon.co.uk mime-version: 1.0 newsgroups: comp.unix.programmer,comp.unix.internals,comp.unix.osf.osf1,comp.unix.solaris,comp.unix.ultrix,comp.unix.aix,comp.unix.aux x-mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3 sun4m) andrew@cucumber.demon.co.uk (Andrew Gabriel) wrote: >>To all UNIX programmers, of all taste, can anyone tell me if the >>following system call are supported/implemented on your system ? >> >>shmget, shmat, shmctl, -- shared memory call >>msgget, msgsnd, msgrcv, msgctl, -- message queue call >>semget, semop, semctl, -- semaphore call >> They've been available on all the UNIX platforms I've looked at, although that's by no means an exhaustive list. However, I have hit problems on SunOS systems (SunOS 4, what most people call SunOS except for Sun who like to think of it as Solaris 1..). On this the system V IPC stuff is optional, and you can certainly hit systems where it hasn't been configured in. I have in the past had to persuade system managers to include it just to get some of my stuff to run. Even if it's included, it often isn't included with enough resources. I've had to get number of semaphores increased, and if you want a lot of shared memory (megabytes) then you'll certainly have to get this increased on many systems. On SunOS you're probably better off using mmap(). But, of course, some older systems (ULTRIX, for example) don't have mmap(). It's very awkward. I've ended up with system dependent include files that control whether my code uses mmap() or system V IPC for shared memory. Message queues and semaphores are generally less of a problem (for me at least, because my stuff uses a lot of shared memory and not many semaphores). Rich Stevens' book suggests using file locking as an alternative to seamphores, and there are other alternatives to message queues. System V IPC is awkward to use, because for one thing it tends to hang around after your program shuts down and continues to get in the way (particularly if your program crashes without releasing it all properly).