Re: Spinlocks and compiler/memory barriers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Spinlocks and compiler/memory barriers
Дата
Msg-id 78643.1403822411@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Spinlocks and compiler/memory barriers  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: Spinlocks and compiler/memory barriers  (Andres Freund <andres@2ndquadrant.com>)
Re: Spinlocks and compiler/memory barriers  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-06-26 14:13:07 -0700, Tom Lane wrote:
>> Surely it had better be a read barrier as well?

> I don't immediately see why it has to be read barrier? Hoisting a load
> from after the release into the locked area of code should be safe?

No doubt, but delaying a read till after the unlocking write would
certainly not be safe.

AFAICT, README.barrier completely fails to define what we think the
semantics of pg_read_barrier and pg_write_barrier actually are, so if
you believe that a write barrier prevents reordering of reads relative to
writes, you'd better propose some new text for that file.  It certainly
doesn't say that today.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #10728: json_to_recordset with nested json objects NULLs columns
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Spinlocks and compiler/memory barriers