Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jan 2002 08:01:23 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Smith <msmith@FreeBSD.ORG>
Cc:        Bernd Walter <ticso@cicely8.cicely.de>, Michal Mertl <mime@traveller.cz>, Matthew Dillon <dillon@apollo.backplane.com>, <arch@FreeBSD.ORG>
Subject:   Re: When to use atomic_ functions? (was: 64 bit counters) 
Message-ID:  <20020102075650.L11121-100000@gamplex.bde.org>
In-Reply-To: <200201012048.g01KmYr01192@mass.dis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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