Re: Move PinBuffer and UnpinBuffer to atomics
От | YUriy Zhuravlev |
---|---|
Тема | Re: Move PinBuffer and UnpinBuffer to atomics |
Дата | |
Msg-id | 1806030.Y4NWmNRp0C@dinodell обсуждение исходный текст |
Ответ на | Re: Move PinBuffer and UnpinBuffer to atomics (Andres Freund <andres@anarazel.de>) |
Ответы |
Re: Move PinBuffer and UnpinBuffer to atomics
|
Список | pgsql-hackers |
On Tuesday 15 September 2015 04:06:25 Andres Freund wrote: > And here's an actual implementation of that approach. It's definitely > work-in-progress and could easily be optimized further. Don't have any > big machines to play around with right now tho. Thanks. Interesting. 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. In this embodiment, there is no significant difference between the two patches. For honest work will need used the CAS for all IF statement. Thanks! Hope for understanding. ^_^ -- YUriy Zhuravlev Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
В списке pgsql-hackers по дате отправления: