Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 1999 12:47:21 -0700 (PDT)
From:      Doug White <dwhite@resnet.uoregon.edu>
To:        Rahul Dhesi <dhesi@rahul.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: looking for test-and-set or atomic swap instruction
Message-ID:  <Pine.BSF.4.03.9905121247130.23756-100000@resnet.uoregon.edu>
In-Reply-To: <199905062251.AA19855@bolero-x.rahul.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 6 May 1999, Rahul Dhesi wrote:

> I am looking for a machine instruction that could be used to implement
> mutual exclusion in software, similar to the traditional test-and-set or
> atomic swap instructions, and some way of invoking it from within C code
> from within FreeBSD 3.x.  Any suggestions?  More info below.
> 
> I don't expect to be using a multiprocessing system, so perhaps that
> should make things easier.
> 
> I can't use any lock that requires a system call.  I am making accesses
> to common shared memory from multiple processes, and a system call would
> be too costly.  The rate of shared memory access will be high but
> conflicts will be very rare, so a spin lock will do just fine.

Pthreads?

Doug White                               
Internet:  dwhite@resnet.uoregon.edu    | FreeBSD: The Power to Serve
http://gladstone.uoregon.edu/~dwhite    | www.freebsd.org



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