2.2 and shmat()

New Message Reply Date view Thread view Subject view Author view

Robert D. King (king++at++ait.nrl.navy.mil)
Mon, 3 Aug 1998 13:48:25 -0400 (EDT)


pfPlease Help!

We are upgrading our application from Performer 2.1 to 2.2, and
our interprocess communication code has stopped working. We have
two processes (separate programs) which communicate via shared
memory and semaphores. The data process (legacy code) provides an
asynchronous interface to several external systems. The render
process is derived from perfly.

Shared memory is allocated by the data process. We attach to it
in the render process... or at least we used to. Having recompiled
and linked with Performer 2.2, our call to shmat() in our render
process as shown below now fails, with errno=ENOMEM.

key_t memKey = 0x1234567 // our unique key, unique eh?
size_t ttlSize = 0x210000 // big enough for our purposes
#define SHM_ADRESS 0x04200000 // the result of some tuning
int ipcArenaId;
void * ipcArena;

// we create and attach to the shared arena in the data process with
ipcArenaId = shmget (memKey, ttlSize, 0666 | IPC_CREAT | IPC_EXCL);
ipcArena = (IPCMemArena *) shmat(ipcArenaId, (void *)SHM_ADDRESS, 0);

// we find and attach to the shared arena in the render process with
ipcArenaId = shmget (memKey, ttlSize, 0);
ipcArena = (IPCMemArena *) shmat(ipcArenaId, (void *)SHM_ADDRESS, 0);
if (((void *)-1) == ipcArena)
    perror ("Process error:"); // <<=== we fail here here

We know that the shmget() call is producing the correct id, but the
shmat () call fails. We're using a four processor InfiniteReality
with 1024 Mbytes of main memory. Irix 6.2,Performer 2.2 (patch 3229).

I have the notion that the cause is thread-related, as we had
similar problems trying to mix threads and shared memory in the
past.

Ideas? Suggestions? Comments?

Thanks in advance,
Rob (*Whaddaya mean I don't have enough memory!*) King

--------------------------------------------------------
king++at++ait.nrl.navy.mil http://www.ait.nrl.navy.mil/people/king
On site: (202) 767-6025 Office: (703) 938-2032

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Aug 11 1998 - 13:42:34 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.