From owner-freebsd-hackers Mon Jul 8 06:11:30 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA02884 for hackers-outgoing; Mon, 8 Jul 1996 06:11:30 -0700 (PDT) Received: from terra.Sarnoff.COM (terra.sarnoff.com [130.33.11.203]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA02873 for ; Mon, 8 Jul 1996 06:11:24 -0700 (PDT) Received: (from rminnich@localhost) by terra.Sarnoff.COM (8.6.12/8.6.12) id JAA19033; Mon, 8 Jul 1996 09:10:53 -0400 Date: Mon, 8 Jul 1996 09:10:53 -0400 (EDT) From: "Ron G. Minnich" X-Sender: rminnich@terra To: hackers@freebsd.org Subject: Re: filemalloc etc. for shared memory between processes In-Reply-To: <199607080957.MAA19692@office.elvisti.kiev.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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). ron