Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2003 10:25:05 +0200
From:      Pawel Jakub Dawidek <nick@garage.freebsd.pl>
To:        Jeffrey Hsu <hsu@FreeBSD.ORG>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Dynamic reads without locking.
Message-ID:  <20031010082505.GG520@garage.freebsd.pl>
In-Reply-To: <20031009194644.50B9116A4BF@hub.freebsd.org>
References:  <20031009194644.50B9116A4BF@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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