From owner-freebsd-hackers Tue Jan 7 04:48:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id EAA20169 for hackers-outgoing; Tue, 7 Jan 1997 04:48:04 -0800 (PST) Received: from mail.crl.com (mail.crl.com [165.113.1.22]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id EAA20134 for ; Tue, 7 Jan 1997 04:48:01 -0800 (PST) Received: from hda.hda.com (ip48-max1-fitch.ziplink.net) by mail.crl.com with SMTP id AA19610 (5.65c/IDA-1.5 for ); Tue, 7 Jan 1997 04:47:56 -0800 Received: (from dufault@localhost) by hda.hda.com (8.6.12/8.6.12) id HAA02180; Tue, 7 Jan 1997 07:41:07 -0500 From: Peter Dufault Message-Id: <199701071241.HAA02180@hda.hda.com> Subject: Re: mmap() updates...how often? In-Reply-To: from The Hermit Hacker at "Jan 7, 97 06:18:20 am" To: scrappy@hub.org (The Hermit Hacker) Date: Tue, 7 Jan 1997 07:41:06 -0500 (EST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL25 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Not quite sure how to word this one, but how often does > an mmap() region get updated, in so far as client processes seeing > the data that the server process writes to it? > > The reason I'm asking is that I have a program that is using > mmap() to pass frames from a central server to client processes. The > central server is writing, on average, 20frames/sec to the mmap()'d > region, and after each write, it sets a counter, also mmap()'d, that > the client uses as, more or less, a position indicator. I do something similar, running a simulation that puts a simulation frame in a shared region and then writes a token to a simulation pipeline to synchronize the stages of the pipeline. I don't use msync() and haven't had any funny problems. One difference may be that my entire pipeline is synchronized (each stage passes the token along until it comes back to the originator) since there is ordering in the stages. I'm sure you're using MAP_SHARED. -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936