From: <web...@st...> - 2003-01-17 09:55:00
|
On Thu, 16 Jan 2003, Brian Goetz wrote: | > because the cache is immutable and therefore can be used unsynchronized. | | ... on uni-processor systems, or on multi-processor systems that have | a stronger memory model than the JLS requires, which would include Intel, | but not PPC, Alpha, or some configurations of Sparc ... This I have also always though about: you _cannot_ go about being unsynchronized "all the time" on such non-cache-synched systems, thus probably raising problems for Lane's cache. HOWEVER, isn't entering a synchronized block actually committing _everything_ of that thread's unflushed cache back to memory (and invalidating it)? So that, if this is in a servlet, then you _would_ have had some synchronized blocks around some other part of the system/engine. Wouldn't this also have changed the reference to the "unsynched" map of Lane? - The system works by having one unsynched map, and one synched "for backup". Then, after some time, the synched map is remade to be a unsynched map, and then put in place of the existing unsynched map. The problem is of course that this won't propagate to the 'other processors' on the system.. Well.. If the synch-semantics require _all_ cache to be flushed back to main memory, wouldn't this _eventually_ propagate to the other processors, in a consistent way, with e.g. the next HttpSession lookup by the servlet container? If not, what if the reference to the synched map is declared 'volatile'? Would that change anything? What happens to the objects in the map? Would you actuall be able to get hold of memory areas that weren't initialized, as the other thread would have freed some parts of his view of the memory (e.g. freeing the synched map), and then allocated some (and overlapping) parts of the memory to the new map (which he puts to the volatile reference).. ? If those questions just sounds stupid, I must have phrased myself wrongly, because they aren't stupid! No-one has answered them satisfactory yet! ;) I would love if for example you, Brian, gave it a shot! -- Mvh, Endre Stølsvik M[+47 93054050] F[+47 51625182] Developer @ CoreTrek AS - http://www.coretrek.com/ CoreTrek corporate portal / EIP - http://www.corelets.com/ |