From owner-freebsd-hackers Wed Oct 10 8:17:14 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from nas.dgap.mipt.ru (nas.dgap.mipt.ru [194.85.81.203]) by hub.freebsd.org (Postfix) with ESMTP id C759037B408 for ; Wed, 10 Oct 2001 08:17:08 -0700 (PDT) Received: from localhost (andrew@localhost) by nas.dgap.mipt.ru (8.11.6/8.11.6) with ESMTP id f9AFGlI51376; Wed, 10 Oct 2001 19:16:48 +0400 (MSD) (envelope-from andrew@nas.dgap.mipt.ru) Date: Wed, 10 Oct 2001 19:16:46 +0400 (MSD) From: "Andrew L. Neporada" To: Matt Dillon Cc: Maxime Henrion , Dwayne , freebsd-hackers@FreeBSD.ORG Subject: Re: Memory allocation question In-Reply-To: <200110030552.f935q5j63360@earth.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 2 Oct 2001, Matt Dillon wrote: > > : > :Dwayne wrote: > :> I'm creating an app where I want to use memory to store data so I > :> can get at it quickly. The problem is, I can't afford the delays that > :> would occur if the memory gets swapped out. Is there any way in FreeBSD > :> to allocate memory so that the VM system won't swap it out? > :> > :I think mlock(2) is what you want. > : > :Maxime Henrion > :-- > :Don't be fooled by cheap finnish imitations ; BSD is the One True Code > > Don't use mlock(). Could you please explain that. Thanks. > > Use SysV Shared memory segments. If you tell the kernel to use > physical ram for SysV shared memory (kern.ipc.shm_use_phys=1) > then any shm segments you allocate (see manual pages for > shmctl, shmget, and shmat) will reside in unswappable shared memory. > > -Matt > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message