[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another multithreading bug (I think)
From: |
Wim Oudshoorn |
Subject: |
Re: Another multithreading bug (I think) |
Date: |
Mon, 11 Sep 2006 15:21:10 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/22.0.50 (darwin) |
Pete French <pete@twisted.org.uk> writes:
>> Thread B on Processor B sees isCreated = 1, but still has a stale
>> value (nil) for 'theInstance' in its L1/L2 memory cache
>> and returns the nil.
>
> I can't imagine that this would ever happen - if processors in an SMP
> system had independent caches such that they saw different cached values
> for the same location then it wouldnt work at all. The cache consistency
> mechanism is there to ensure that this never happens, so it shouldnt be an
> issue.
>
Well, I think that consistency is only guarenteed when locking is used
appropriately.
For example in the paper:
Impact of Java Memory Model on Out-of-Order Multiprocessors
by Tulika Mitra, Abhik Roychoudhury, Qinghua Shen
from School of Computing National University of Singapore
The examine the old an new proposed Java Memory Model.
They claim that: [BEGIN QUOTE]
Thread 1 Thread 2
Write a,1 read volatile v
Write a,2 read a
Write volatile v, 1
assuming v and a are initialized to 0, it is possible to read
v=1 and a=1 in the second thread
[END QUOTE]
They are discussing the current Java Memory Model.
But I am trying to find more documentation on multi processor architectures
to really understand what is happening.
Wim Oudshoorn.
- Re: Another multithreading bug (I think), (continued)
- Re: Another multithreading bug (I think), David Ayers, 2006/09/08
- Re: Another multithreading bug (I think), Richard Frith-Macdonald, 2006/09/08
- Multithreading, Wim Oudshoorn, 2006/09/08
- Re: Multithreading, Richard Frith-Macdonald, 2006/09/09
- Re: Multithreading, Wim Oudshoorn, 2006/09/09
- Re: Multithreading, Richard Frith-Macdonald, 2006/09/09
- Re: Another multithreading bug (I think), Wim Oudshoorn, 2006/09/11
- Re: Another multithreading bug (I think), Pete French, 2006/09/11
- Re: Another multithreading bug (I think),
Wim Oudshoorn <=
- Re: Another multithreading bug (I think), Wim Oudshoorn, 2006/09/11
- Re: Another multithreading bug (I think), Wim Oudshoorn, 2006/09/08