Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jun 2000 21:46:23 -0400 (EDT)
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, hackers@freebsd.org
Subject:   Re: uidinfo has many race conditions.
Message-ID:  <Pine.BSF.4.21.0006102142280.1037-100000@green.dyndns.org>
In-Reply-To: <Pine.BSF.4.21.0006102104470.68954-100000@salmon.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 Jun 2000, Doug Rabson wrote:

> > Well if we get an atomic_t it could be done that way, even if we
> > fail the race for updating and go beyond our rlimit slightly it's
> > much cheaper than a spinlock from my PoV.  The only problem is
> > that afaik on some archs atomic_t can be quite small, we'd have
> > to watch for overflow, perhaps a spinlock is a better idea however
> > only if the next thing I mention here is realized:
> 
> You can use atomic_add_*() to do safe arithmetic on memory locations.

Yeah, but rlim_t isn't small enough to do that on an i386 :(  Anyway,
I don't think race conditions will ever really happen with the code,
since the only interrupts that can modify sbsize are the PF_LOCAL
ones, and those are (AFAIK) synchronous.

> -- 
> Doug Rabson				Mail:  dfr@nlsystems.com
> Nonlinear Systems Ltd.			Phone: +44 20 8442 9037

--
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green@FreeBSD.org                    `------------------------------'



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