From owner-freebsd-ia64 Wed Oct 10 12: 4:13 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by hub.freebsd.org (Postfix) with ESMTP id 4CE8537B410 for ; Wed, 10 Oct 2001 12:04:05 -0700 (PDT) Received: (qmail 98147 invoked from network); 10 Oct 2001 19:04:04 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Oct 2001 19:04:04 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 10 Oct 2001 12:03:30 -0700 (PDT) From: John Baldwin To: John Polstra Subject: RE: rtld -- atomic ops Cc: Doug Rabson , ia64@FreeBSD.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 10-Oct-01 John Polstra wrote: > John Baldwin wrote: >> >> One quick question. Now that we have a MI atomic operation interface one >> can >> get from that includes atomic_cmpset_acq_int(), >> atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of >> re-rolling the atomic operations each time? I realize that do to the quirky >> nature of the 386, you would still have to have a hack for the x86 platform, >> but at least for 486+ and other arch's you could just use the pre-existent >> API >> so that we only have to code up atomic ops in one place. >> >> Comments? > > That would be great, as far as I'm concerned. Note, the reader/writer > locks used by the dynamic linker require something resembling an > atomic compare and exchange operation. That's exactly what atomic_cmpset() is. :) Although it doesn't guarantee an exchange (i.e., it doesn't return the old value if the cmp succeeds). > John -- John Baldwin -- 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-ia64" in the body of the message