Re: Latches with weak memory ordering (Re: max_wal_senders must die)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Latches with weak memory ordering (Re: max_wal_senders must die)
Дата
Msg-id 201011192033.45551.andres@anarazel.de
обсуждение исходный текст
Ответ на Re: Latches with weak memory ordering (Re: max_wal_senders must die)  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Friday 19 November 2010 20:03:27 Andres Freund wrote:
> Which means something like (in intel's terminology) can happen:
> 
> initially x = 0
> 
> P1: mov [_X], 1
> P1: lock xchg Y, 1
> 
> P2. lock xchg [_Z], 1
> P2: mov r1, [_X]
> 
> A valid result is that r1 on P2 is 0.
> 
> I think that is not biting pg because it always uses the same spinlocks at
> the  reading and writing side - but I am not that sure about that.
Which also seems to mean that a simple read memory barrier that does __asm__ 
__volatile__("lock; xaddl $0, ???") seems not to be enough unless you use the 
same address for all those barriers which would cause horrible cacheline 
bouncing.

Am I missing something?

Andres



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: UNNEST ... WITH ORDINALITY (AND POSSIBLY OTHER STUFF)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: duplicate connection failure messages