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

-- 
Pawel Jakub Dawidek                       [EMAIL PROTECTED]
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to