From owner-freebsd-current Thu Nov 16 01:08:55 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA17689 for current-outgoing; Thu, 16 Nov 1995 01:08:55 -0800 Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id BAA17677 for ; Thu, 16 Nov 1995 01:08:53 -0800 Received: from critter.tfs.com by tfs.com (smail3.1.28.1) with SMTP id m0tG0JP-0003wlC; Thu, 16 Nov 95 01:08 PST Received: from localhost (localhost [127.0.0.1]) by critter.tfs.com (8.6.11/8.6.9) with SMTP id KAA04455; Thu, 16 Nov 1995 10:08:49 +0100 X-Authentication-Warning: localhost.tfs.com: Host localhost didn't use HELO protocol To: "Garrett A. Wollman" cc: current@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_sysctl.c In-reply-to: Your message of "Wed, 15 Nov 1995 12:08:47 EST." <9511151708.AA26231@halloran-eldar.lcs.mit.edu> Date: Thu, 16 Nov 1995 10:08:48 +0100 Message-ID: <4453.816512928@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-current@freebsd.org Precedence: bulk > < 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.