Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 1997 09:03:32 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        dufault@hda.com (Peter Dufault)
Cc:        scrappy@hub.org, hackers@FreeBSD.ORG
Subject:   Re: mmap() updates...how often?
Message-ID:  <199701071403.JAA05460@dyson.iquest.net>
In-Reply-To: <199701071241.HAA02180@hda.hda.com> from "Peter Dufault" at Jan 7, 97 07:41:06 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > 	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.
> 
I would think that the problem is that you have a process dumping
data into the mmapped region?  And another looking at it?  I
think that you need to wake-up the consumer process for every
frame (somehow -- perhaps with sending a message through a
pipe or SYSVSEM???)  If you don't do that, then you'll simply
be dependent on the process scheduler -- and that can do almost
ANYTHING to you.

John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701071403.JAA05460>