Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jun 1998 12:12:25 -0400 (EDT)
From:      "David E. Brooks Jr" <dbj@iglou.com>
To:        freebsd-questions@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG
Subject:   mmap() and process synchronization
Message-ID:  <Pine.BSF.3.96.980627114056.1717A-100000@localhost>

next in thread | raw e-mail | index | archive | help
I'm looking into using mmap() for sharing memory (read/write) between
multiple process, which of course means I'll need a means of
synchronization.  Not being overly fond of the System V semaphore
routines, I looked for alternatives.

Particularly intriguing was the reference to a MAP_HASSEMAPHORE flag
in the mmap(2) man page.  The 'newvm' paper (in /usr/share/doc/papers) 
was informative, so I eagerly went looking for the mset()/mclear()
code to see how it was implemented.

Sadly they're not implemented in 2.2.6-STABLE.  This is too bad since
mset()/mclear() look far faster in concept than the System V
alternative.  Is there any plan to implement mset(), mclear(),
msleep() and mwakeup()?  It doesn't seem they would be overly
difficult to implement correctly (but I've never done any kernel-level
work, either).

This leads me to my second question: Foregoing the availability of
mset() and company, what is considered the "canonical' method of
process synchronization when using mmap()?  System V semaphores?
flock(2)?  (Neither of those approaches are particularly appealing).

-- Dave

--
David E. Brooks Jr
  dbj@iglou.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980627114056.1717A-100000>