From owner-freebsd-hackers Mon Jul 8 16:02:00 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA15952 for hackers-outgoing; Mon, 8 Jul 1996 16:02:00 -0700 (PDT) Received: from kropotkin.gnu.ai.mit.edu (kropotkin.gnu.ai.mit.edu [128.52.46.40]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id QAA15945 for ; Mon, 8 Jul 1996 16:01:57 -0700 (PDT) Received: by kropotkin.gnu.ai.mit.edu (8.6.12/8.6.12GNU) id TAA28262; Mon, 8 Jul 1996 19:00:32 -0400 Date: Mon, 8 Jul 1996 19:00:32 -0400 Message-Id: <199607082300.TAA28262@kropotkin.gnu.ai.mit.edu> To: stesin@elvisti.kiev.ua CC: hackers@freebsd.org In-reply-to: <199607080957.MAA19692@office.elvisti.kiev.ua> (stesin@elvisti.kiev.ua) Subject: Re: filemalloc etc. for shared memory between processes From: Joel Ray Holveck Reply-to: joelh@gnu.ai.mit.edu Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> What about using one mmap'd region, then dividing it up >> malloc-style > I wonder how one should properly implement locking of memory > regions in this case. Will appropriate fcntl(2) be enough? It will work, but is slow. Instead, use msleep() and friends. You'd need to have the malloc/free also do locking; simply using mmalloc() or something of the like could result in a corrupt arena, unless the apps really have their algorithms together. -- http://www.wp.com/piquan --- Joel Ray Holveck --- joelh@gnu.ai.mit.edu Fourth law of computing: Anything that can go wro .signature: segmentation violation -- core dumped