Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 1995 12:08:47 -0500
From:      "Garrett A. Wollman" <wollman@lcs.mit.edu>
To:        Poul-Henning Kamp <phk@critter.tfs.com>
Cc:        current@freebsd.org
Subject:   Re: cvs commit: src/sys/kern kern_sysctl.c 
Message-ID:  <9511151708.AA26231@halloran-eldar.lcs.mit.edu>
In-Reply-To: <3126.816454522@critter.tfs.com>
References:  <9511151641.AA26165@halloran-eldar.lcs.mit.edu> <3126.816454522@critter.tfs.com>

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.

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence.  We like people
MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant



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