From owner-freebsd-hackers Mon Jul 8 18:22:34 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA20834 for hackers-outgoing; Mon, 8 Jul 1996 18:22:34 -0700 (PDT) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA20825 for ; Mon, 8 Jul 1996 18:22:32 -0700 (PDT) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.7.5/CET-v2.1) with SMTP id BAA18831; Tue, 9 Jul 1996 01:22:25 GMT Date: Tue, 9 Jul 1996 10:22:24 +0900 (JST) From: Michael Hancock To: "Ron G. Minnich" cc: hackers@freebsd.org Subject: Re: filemalloc etc. for shared memory between processes In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Mon, 8 Jul 1996, Ron G. Minnich wrote: > > I wonder how one should properly implement locking of memory > > regions in this case. Will appropriate fcntl(2) be > > enough? > > no, you use the fastlock() i posted earlier. fcntl is probably the worst > way there is to lock shared regions. You want memory-value-based locking > so you can use compare-and-swap (or equivalent). I read in the New Frontiers book about 4.4bsd semaphores; something like mset and mclear, but I didn't see any mention of this in the 4.4 deamon book. Does the pthreads lib have facilities for locking data structures in shared memory? -mike