From owner-freebsd-arch Tue Jan 1 13: 1:35 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D392437B41F; Tue, 1 Jan 2002 13:01:31 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id IAA20393; Wed, 2 Jan 2002 08:01:28 +1100 Date: Wed, 2 Jan 2002 08:01:23 +1100 (EST) From: Bruce Evans X-X-Sender: To: Mike Smith Cc: Bernd Walter , Michal Mertl , Matthew Dillon , Subject: Re: When to use atomic_ functions? (was: 64 bit counters) In-Reply-To: <200201012048.g01KmYr01192@mass.dis.org> Message-ID: <20020102075650.L11121-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 1 Jan 2002, Mike Smith wrote: > > MBs are not needed for the variable itself, but they are making this > > family of functions very expensive. > > It's not very wise to handle counters with atomic_ functions unless > > the need to have MBs in them is not removed. > > It's imperative to use atomic operations for counters on SMP systems. Not true. Atomic operations for counters are not needed on SMP systems in at least the following cases: - if there is a lock that prevents other processes from accessing the counter - if the counters are per-CPU. See previous mail by someone named msmith. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message