Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 1998 19:32:00 -0400 (EDT)
From:      "David E. Brooks Jr" <dbj@iglou.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        hackers@FreeBSD.ORG
Subject:   mlock()/mclear (was Re: Unsupport calls)
Message-ID:  <Pine.BSF.3.96.980630190503.929A-100000@localhost>
In-Reply-To: <199806302142.OAA21104@usr02.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Jun 1998, Terry Lambert wrote:

> It is trivial to implement p/v semaphores using __asm__ to generate
> single instruction spinlocks; since the VM/buffer cache is unified,
> this will work on shared memory/mmap'ed files without needing a
> special system call to guaranteee lock coherency.
> 
> 
> 					Terry Lambert
> 					terry@lambert.org

Funny you should mention this.  I was poking around the man page to
mmap() the other day looking for any hints on a "standard" way to
perform inter-process synchronization when sharing memory.  This led
me to read the 'newvm' paper, specifically about
mlock()/mclear(). Well, to make a short story even shorter, I ended up
having a brief e-mail exchange with David Greenman where he said in my
mail batch this morning "...a bright beginner could tackle it."

So, I figured I'd try and find out how bright I really am <grin>.

I haven't gotten very far (I'm re-reading relevant portions of _The
Design and Implementation of 4.4 BSD Operating System_ and lots of
stuff in section 9 right now), but I do have one question right off
the bat.  Both mmap(2) and the newvm paper make mention of the
MAP_HASSEMAPHORE flag; Why is (or was) this necessary?  All that comes
to mind is multi-processor systems and keeping any copies of that
page of memory synchronized.

Thanks!

-- Dave

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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" 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.980630190503.929A-100000>