Date: Tue, 10 Dec 1996 13:20:06 -0500 (EST) From: "Marc G. Fournier" <scrappy@hub.org> To: "Eric L. Hernes" <erich@lodgenet.com> Cc: hackers@FreeBSD.ORG Subject: Re: Multiple Buffer allocation of Shared Memory Message-ID: <Pine.NEB.3.95.961210130845.374A-100000@hub.org> In-Reply-To: <199612100156.TAA00658@jake.lodgenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 9 Dec 1996, Eric L. Hernes wrote: > "Marc G. Fournier" writes: > > > >Hi... > > > > Just starting to play with shared memory, and have hit a wall > >that I don't know if its too be expected, or if I've screwed something > >up... > > Shared memory is cool, SysV symantics for shared memory *suck*, if at all > possible use mmap(). BSDi uses libc wrappers around mmap() for > it's SysV shm stuff, but there's caveats... I'd like the wrappers, > but have the real ones available too. > Okay...maybe I'm missing something as far as mmap() is concerned, but what I want to be able to do is allocated X bytes of memory to be shared amongst several processes. After the memory is allocated, I will *then* want to fill the memory (ie. with data read from a socket). From reading the mmap() man page (any good reference/textbooks that I might want to pick up?), mmap() allocates and fills the memory space at the same time, based on a previously opened, already existing, file (fd). Is there something I'm missing? With shared memory, this isn't a problem, or, at least, from what I've read, won't be a problem... > #ifndef SHMSEG > #define SHMSEG 8 > #endif > > you can only have 8 shm segments by default, you can override > it with: `options "SHMSEG=32"' or something similar in your config file. > I usually bump SHMSEG to 128 and SHMMAXPGS to 4096. > Did this, got this: ----- hub> ./client No space left on device cannot initialize shared memory buffer #29 ----- At least I'm getting 28 buffers created now, instead of just 8 :) Now, am I understanding what I've configured correctly? With SHMSEG=128 and SHMMAXPGS=4096, I should be able to allocate up to 128 pages of 4096k each? I actually set SHMSEG to 256, mind you...just in case. options SYSVSHM options SYSVSEM options SYSVMSG options "SHMSEG=256" options "SHMMAXPGS=4096" Marc G. Fournier scrappy@hub.org Systems Administrator @ hub.org scrappy@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.961210130845.374A-100000>