Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2000 20:12:28 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        arch@FreeBSD.org, (Mike Smith) <msmith@FreeBSD.org>, (Chuck Paterson) <cp@bsdi.com>, (Alfred Perlstein) <bright@wintelcom.net>
Subject:   Re: we need atomic_t
Message-ID:  <XFMail.001013201228.jhb@FreeBSD.org>
In-Reply-To: <200010130251.TAA03945@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 13-Oct-00 Terry Lambert wrote:
>> The reason for atomic_init/destroy is to intialize mutexes if they
>> are needed on the arch.  Basically atomic64_t on 32bit arches would
>> be a struct with a 64bit value and a mutex to protect it.
> 
> Tee hee hee.
> 
> How do I initialize the mutex that protects the mutex?

Our mutexes use a pointer for the lock, so they use uintptr_t,
not the would-be atomic_t.  The reason for an atomic_t really
is to provide a cheap way to do MP safe refcounts, etc. w/o
having to use mutexes if at all possible.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


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




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