Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease
От | Tom Lane |
---|---|
Тема | Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease |
Дата | |
Msg-id | 11505.1392048688@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease (Andres Freund <andres@2ndquadrant.com>) |
Ответы |
Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease
Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease |
Список | pgsql-hackers |
Andres Freund <andres@2ndquadrant.com> writes: > So what we need to do is to acquire a write barrier between the > assignments to lwWaitLink and lwWaiting, i.e. > proc->lwWaitLink = NULL; > pg_write_barrier(); > proc->lwWaiting = false; You didn't really explain why you think that ordering is necessary? Each proc being awoken will surely see both fields updated, and other procs won't be examining these fields at all, since we already delinked all these procs from the LWLock's queue. > There is the question what to do about the branches without barriers? I > guess a SpinLockAcquire()/Release() would do? Or do we decide it's not > important enough to matter, since it's not an issue on x86? Given the lack of trouble reports that could be traced to this, I don't feel a need to worry about it in branches that don't have any barrier support. But in any case, I'm not convinced there's a bug here at all. regards, tom lane
В списке pgsql-hackers по дате отправления: