Interesting scenario encountered today in multithreading. If you have a scenario like this
temp = read(a)
if (P(temp))
write(a)In that case if you don't care about sometimes incorrect results in read(a) during P(temp) (which happen during nonatomic partial writes), then you may only lock write(a), and read without locking. You may not care in
(
Read more... )