Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Apr 1998 07:59:55 -0400 (EDT)
From:      Peter Dufault <dufault@hda.com>
To:        phk@critter.freebsd.dk (Poul-Henning Kamp)
Cc:        gurney_j@resnet.uoregon.edu, freebsd-current@FreeBSD.ORG
Subject:   Re: kernel support for memory semaphores/locks...
Message-ID:  <199804081159.HAA02471@hda.hda.com>
In-Reply-To: <2165.891967475@critter.freebsd.dk> from Poul-Henning Kamp at "Apr 7, 98 06:44:35 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> Make your own lock with the cmp8xchg instruction, just like the kernel 
> does.  Check the "lock" instruction on the i386.  Also check out the
> "mplock.[schwhatever]" somewhere in the kernel.
> 
> >using assembly to do atomic locking isn't an option as you would have
> >to spin on the lock...
> 
> No, you'd go to sleep for a jiffy and check again...  I belive a yield()
> syscall is in the pipeline or maybe already in.

Someone has done this - who remembers?  I think at Sarnoff.  Search
the archives.  I think it trys first and then sleeps if busy.  You
could also use a try first then enqueu a request to a server if you
want FIFO behavior, etc.  There are many ways to skin this cat.

P1003.1B semaphore semantics are in progress.

Peter

-- 
Peter Dufault (dufault@hda.com)   Realtime development, Machine control,
HD Associates, Inc.               Safety critical systems, Agency approval

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



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