Re: locked reads for atomics

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: locked reads for atomics
Дата
Msg-id 20240223161758.GA1697194@nathanxps13
обсуждение исходный текст
Ответ на Re: locked reads for atomics  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: locked reads for atomics  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Thu, Feb 22, 2024 at 11:53:50AM -0800, Jeff Davis wrote:
> On Thu, 2024-02-22 at 12:58 +0530, Bharath Rupireddy wrote:
>> There's some immediate use for reads/writes with barrier semantics -
> 
> Is this mainly a convenience for safety/readability? Or is it faster in
> some cases than doing an atomic access with separate memory barriers?

The former.  Besides the 0002 patch tracked here, there's at least one
other patch [0] that could probably use these new functions.  The idea is
to provide an easy way to remove spinlocks, etc. and use atomics for less
performance-sensitive stuff.  The implementations are intended to be
relatively inexpensive and might continue to improve in the future, but the
functions are primarily meant to help reason about correctness.

I don't mind prioritizing these patches, especially since there now seems
to be multiple patches waiting on it.  IIRC I was worried about not having
enough support for this change, but I might now have it.

[0] https://commitfest.postgresql.org/47/4330/

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: SQL Property Graph Queries (SQL/PGQ)
Следующее
От: Давыдов Виталий
Дата:
Сообщение: Re: Slow catchup of 2PC (twophase) transactions on replica in LR