Re: Typo in README.barrier

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: dgrowleyml(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Typo in README.barrier
Date: 2021-05-16 13:29:30
Message-ID: 20210516.222930.2184336770600462546.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Yeah looks like a typo to me.

Ok.

> I wonder if we also need to fix this part:
>
>> either one does their writes. Eventually we might be able to use an atomic
>> fetch-and-add instruction for this specific case on architectures that support
>> it, but we can't rely on that being available everywhere, and we currently
>> have no support for it at all. Use a lock.
>
> That seems to have been written at a time before we got atomics.
>
> The following also might want to mention atomics too:
>
>> 2. Eight-byte loads and stores aren't necessarily atomic. We assume in
>> various places in the source code that an aligned four-byte load or store is
>> atomic, and that other processes therefore won't see a half-set value.
>> Sadly, the same can't be said for eight-byte value: on some platforms, an
>> aligned eight-byte load or store will generate two four-byte operations. If
>> you need an atomic eight-byte read or write, you must make it atomic with a
>> lock.

Yes, we'd better to fix them. Attached is a propsal for these.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
README.barrier_v2.diff text/x-patch 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2021-05-16 14:10:49 Re: naming of async_mode parameter
Previous Message Phil Godfrin 2021-05-16 12:57:01 FDW and connections