Re: JavaMemoryModel: Volatiles - where does SC work and PO doesn'

From: Jeremy Manson (jmanson@cs.umd.edu)
Date: Tue Nov 21 2000 - 11:32:20 EST


>
> The difference of interest between SC and PO is that if two processors
> perform multiple writes then all processors will observe the writes of each
> of these processors in the order written (just as with SC) but the
> interleaving of the writes may appear different to different processors. I'm
> looking for algorithms where observing different interleavings of writes on
> different processors breaks the algorithm.
>
> Put another way, I'm trying to find useful algorithms where a total ordering
> of stores is needed instead of a partial ordering of the stores.

What about a simple producer / consumer queue? A producer fills up a
buffer and a consumer removes data from it. There is a tail pointer,
and the buffer is stored in an array. The producer says write a new
value into the array and advance the tail pointer. The consumer reads
it by saying that if the tail pointer has advanced from where the
consumer last saw it, read the value out of the array. In this case,
the consumer doesn't delete the value. If writes can be seen in
different orders on different processors, then the consumer might see
the updated tail pointer without seeing the new value.

Or did I misunderstand your question?

                                        Jeremy

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:28 EDT