Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 1995 10:08:48 +0100
From:      Poul-Henning Kamp <phk@critter.tfs.com>
To:        "Garrett A. Wollman" <wollman@lcs.mit.edu>
Cc:        current@freebsd.org
Subject:   Re: cvs commit: src/sys/kern kern_sysctl.c 
Message-ID:  <4453.816512928@critter.tfs.com>
In-Reply-To: Your message of "Wed, 15 Nov 1995 12:08:47 EST." <9511151708.AA26231@halloran-eldar.lcs.mit.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
> <<On Wed, 15 Nov 1995 17:55:22 +0100, Poul-Henning Kamp <phk@critter.tfs.com>
 said:
> 
> >> The purpose of this is to prevent race conditions even in a
> >> uniprocessor system.
> 
> > what race-conditions ?
> 
> Say process 1 and process 2 are both trying to change some variable.
> Process 1 gets the old value, but blocks before the new value is
> changed.  Process 2 then gets the old value, sets the new value, and
> returns success.  Process 1 then wakes up, and sets its new value,
> thereby obliterating what process 2 had done, with neither process 1
> nor process 2 aware of what happened (unless they go back and check
> again), because they will see the same `old' result.

Ok, I guess that means we need it for that case at least...

--
Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
whois: [PHK]                | phk@ref.tfs.com       TRW Financial Systems, Inc.
Future will arrive by its own means, progress not so.



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