Re: Move PinBuffer and UnpinBuffer to atomics

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Move PinBuffer and UnpinBuffer to atomics
Дата
Msg-id 20150915145044.GA16920@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Move PinBuffer and UnpinBuffer to atomics  (YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
Ответы Re: Move PinBuffer and UnpinBuffer to atomics  (YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
Список pgsql-hackers
On 2015-09-15 12:51:24 +0300, YUriy Zhuravlev wrote:
> We had a version like your patch. But this is only half the work. Example:
> state = pg_atomic_read_u32(&buf->state);
> if ((state & BUF_REFCOUNT_MASK) == 0
>     && (state & BUF_USAGECOUNT_MASK) == 0)

> After the first command somebody can change buf->state and local state not 
> actual.

No, they can't in a a relevant manner. We hold the buffer header lock.

> In this embodiment, there is no significant difference between the two 
> patches. For honest work will need used the CAS for all IF statement.

What?

> Thanks! Hope for understanding. ^_^

There's pretty little understanding left at this point. You're posting
things for review and you seem completely unwilling to actually respond
to points raised.

Greetings,

Andres Freund



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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Move PinBuffer and UnpinBuffer to atomics