From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 8 03:15:34 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFA8616A4B3; Wed, 8 Oct 2003 03:15:34 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id D083943FDD; Wed, 8 Oct 2003 03:15:33 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 17CDA653C2; Wed, 8 Oct 2003 11:15:33 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 51625-02-2; Wed, 8 Oct 2003 11:15:32 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 83CEE653BA; Wed, 8 Oct 2003 11:15:32 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 7211738; Wed, 8 Oct 2003 11:15:18 +0100 (BST) Date: Wed, 8 Oct 2003 11:15:18 +0100 From: Bruce M Simpson To: Pawel Jakub Dawidek Message-ID: <20031008101518.GH6524@saboteur.dek.spc.org> Mail-Followup-To: Pawel Jakub Dawidek , Harti Brandt , freebsd-hackers@freebsd.org, hsu@freebsd.org, rwatson@freebsd.org References: <20031008083059.GA520@garage.freebsd.pl> <20031008114506.I63940@beagle.fokus.fraunhofer.de> <20031008101222.GB520@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <20031008101222.GB520@garage.freebsd.pl> cc: rwatson@freebsd.org cc: freebsd-hackers@freebsd.org cc: hsu@freebsd.org Subject: Re: Dynamic reads without locking. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2003 10:15:35 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 08, 2003 at 12:12:22PM +0200, Pawel Jakub Dawidek wrote: > But I'm not talking about non-atomic reads. What I'm want to show is that > even atomic read (without lock) is dangerous in some cases. >=20 > +> If you don't care about occasionally reading false data (for statistic= s or > +> such stuff) you can go without the lock. >=20 > I'm afraid that many developers thinks that atomic reads are always safe > without locks (there are many such reads in sources). I hope I'm wrong. Correcto. A while back peter@ and I discussed this. If you can think of such places, share what you've found, and let's discuss fixing the offending code so as to avoid nasty races. BMS --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: '' iD8DBQE/g+O1ueUpAYYNtTsRAgdDAJ94v8Xv46lNm5eUGrcn+XUO5RHTBgCgh5iR N7yUSOR1WKgbHq2oltOJH2w= =RJcJ -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q--