alan said:

     One thing I've been puzzling over, but can't tell if it's important or
     not, is a difference in the behavior of shmctl on IRIX and other systems
     (I've tried AIX and Linux).  When called with IPC_RMID, like on line 398
     of src/exec/libdx/mem.c, AIX and Linux both mark the shared memory
     segment for deletion, but don't actually delete it right away.  IRIX
     actually removes the segment immediately.  My understanding of shared
     memory is dim at best, so I don't know if this difference in behavior is
     important or not.

there isn't a problem here.  this trick of allocating segments, attaching all 
child
processes to them, then marking them for deletion, is how that code has always
worked on all platforms in the SMP version of DX.    (historical note: the first
platform DX ever ran SMP on was an 8-way SGI system, almost 10 years ago now.)

what may be confusing is that some systems drop that segment from the display
of what segments are in use, but the segments are actually still allocated 
until the
last process with an open id exits, just like file handles.   why we do it is 
to make sure
the segment gets released if the processes crash unexpectedly, plus it keeps 
other
processes from either accidentally or intentionally attaching to the same 
segments.

the biggest headache in cross-platform shared memory differences is when DX has
to allocate multiple segments to get enough total shared memory to work with.
some systems (like solaris) allocate multiple segments from the top of virtual 
memory
space and work down (like a stack) and most others start low and work up.   but 
shared
libraries have become more common, and some systems attach them to addresses 
right
in the middle of the 4G virtual memory space making it hard to get a contiguous 
chunk
of VM.   the final thing i did to the memory manager - mainly because of 
problems
on 64-bit SGI systems - was to add code so it could cope with discontinuous 
regions
of shared memory in virtual address space.

nancy
[EMAIL PROTECTED]

Reply via email to