[concurrency-interest] volatile guarantee for directbuffer

Holger Peine Holger.Peine at fh-hannover.de
Wed Feb 15 05:30:48 EST 2012


Am 15.02.2012 11:25, schrieb David Holmes:
> Holger Peine writes:
>> Am 15.02.2012 10:18, schrieb David Holmes:
>>> Holger Peine writes:
>>>> Am 15.02.2012 09:26, schrieb Christian Vest Hansen:
>>>>>
>>>>> On Wed, Feb 15, 2012 at 07:59, Holger Peine 
>> <Holger.Peine at fh-hannover.de
>>>>> <mailto:Holger.Peine at fh-hannover.de>> wrote:
>>>>>
>>>>>     Am 14.02.2012 20:46, schrieb Boehm, Hans:
>>>>>     > - If only v is volatile, then x = 1; v = 1; z = 1 does 
>> not ensure
>>>>>     > that the write to x becomes visible before the write to z.
>>>>>
>>>>>     The JMM does ensure that the write to x becomes visible 
>>>> together with
>>>>>     the write to v, and that was the original poster's (Talip Ozturk)
>>>>>     question.
>>>>>
>> David, I hope that my first statement above ("The JMM does
>> ensure that the write to x becomes visible together with the write to
>> v") is correct nevertheless?
> 
> Well the write to x can be visible before the write to y. The happens-before relationship ensures that if you see the write to y then you must see the write to x.

There was no y in the example - but substituting v for y (as I
hope you had intended), I fully agree.

Regards,
Holger.

-- 
Prof. Dr. Holger Peine
Hochschule Hannover, Fakultät IV, Abt. Informatik
Tel: +49(511)9296-1830  Fax: -1810 (shared, please state my name)
Ricklinger Stadtweg 120, D-30459 Hannover, Germany


More information about the Concurrency-interest mailing list