[concurrency-interest] What can an incorrectly synchronized read see?

Aleksey Shipilev shade at redhat.com
Wed Sep 28 05:01:04 EDT 2016


On 09/28/2016 10:52 AM, David Holmes wrote:
> Is there a typo there Aleksey, the only OK outcome you listed was (0,0). ???

Note that in my note, there are two classes of executions, depending on
the sequence of locks/unlocks in (R)eader and (W)riter.

(unsync, sync):
 (0, 0): justified by executions with R->W sequencing
 (0, 1): justified by executions with W->R sequencing
 (1, 0): is not justified by any executions
 (1, 1); justified by executions with W->R sequencing

>> -----Original Message-----
>> From: Concurrency-interest [mailto:concurrency-interest-
>> bounces at cs.oswego.edu] On Behalf Of Aleksey Shipilev
>> Note that unsynchronized read can read either "0" or "1", regardless of
>> if synchronized sees "1" after it.

This is for W->R sequencing.

>> Now, let's see what (V1, V2) combinations do not violate JMM:
>>  (0, 0) -- ok, both see some (default?) "0" write from before
>>  (1, 0) -- NOT OK, r(val):V1 cannot see the w(val,1) that's after in HB!
>>  (0, 1) and
>>  (1, 1) -- NOT OK for this particular execution, because r(val):V2 sees
>> the "future" write w(val,1). Notice, however, that both these results
>> are justified by the execution at the very beginning, when Writer and
>> Reader are sequenced in another order.

This is for R->W sequencing.

Thanks,
-Aleksey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20160928/60e16ead/attachment.sig>


More information about the Concurrency-interest mailing list