From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 10 01:22:27 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 C8B1016A4B3; Fri, 10 Oct 2003 01:22:27 -0700 (PDT) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0441943FDF; Fri, 10 Oct 2003 01:22:27 -0700 (PDT) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id D27593ABB35; Fri, 10 Oct 2003 10:25:05 +0200 (CEST) Date: Fri, 10 Oct 2003 10:25:05 +0200 From: Pawel Jakub Dawidek To: Jeffrey Hsu Message-ID: <20031010082505.GG520@garage.freebsd.pl> References: <20031009194644.50B9116A4BF@hub.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="W302I+VHGNbNYdEm" Content-Disposition: inline In-Reply-To: <20031009194644.50B9116A4BF@hub.freebsd.org> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p9 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: freebsd-hackers@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: Fri, 10 Oct 2003 08:22:27 -0000 --W302I+VHGNbNYdEm Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 09, 2003 at 12:46:44PM -0700, Jeffrey Hsu wrote: +> This case (along with some other cases where locks of atomic reads +> are required) is covered in the paper as +>=20 +> But, one case where locks would be required is if the field +> temporarily holds a value that no one else is supposed to see and +> the writer, operating with the lock held, will store a valid value +> before releasing his lock. In this case, both the writer and +> reader need to hold the lock before accessing this field. This isn't trivial problem for me, because: 1. Are we permitted to don't use locks while atomic read if it depends on writter, not on reader? If I'm adding variable modification and this modification have to be safe, I've to check every read of this variable and add locks everywhere. This order isn't quite correct. 2. If there is a chance for race while writting data not-atomically why we only permit atomic reads? In atomic vs. not-atomic read only probability of race is smaller, but it is still there. --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --W302I+VHGNbNYdEm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP4Zs4T/PhmMH/Mf1AQFYfQP/bUSgpQudG3h5HQ6lW0GMZw0k0U75t65C L7kBG3xx1iPMdOiTHW+/iHjPtwQLZ/V7SmcyrAYiGEnEg12bISNPfjR1zTMYoNnu clqSaaRxAEsQuMCx2fSJrMr4CSeRU3cas7HZgIl/m5toHCJ6fMTpLro+w+ns0LM2 0wqe14JBIBQ= =ijTX -----END PGP SIGNATURE----- --W302I+VHGNbNYdEm--