shared memory

Bill Poser poser at csli.Stanford.EDU
Mon Dec 11 17:55:41 AEST 1989


In attempting to use shared memory for large (hundreds of KB) 
objects, I have run into what seem to be nearly insuperable portability
problems. At first I was optimistic, as the System V shared memory
facilities seem to have spread to most versions of UNIX, without
even any differences in syntax. However, I have discovered that
two crucial parameters differ widely from system to system and
that there appears to be no way to change them other than
rebuilding the kernel, which is not always an option. The two
parameters are the maximum size of a shared memory segment and
the separation between the end of the program's data segment and
the virtual address at which shared memory segments are attached. 
This distance determines the maximum amount of ordinary
(non-shared) memory that a program can (s)brk. 

Am I correct in concluding that one simply cannot use shared memory
portably for large objects or if one may need to allocate large amounts
of ordinary memory dynamically?



More information about the Comp.unix.wizards mailing list