Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!) |
| Дата | |
| Msg-id | 9973.1284308940@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!) (Jeff Davis <pgsql@j-davis.com>) |
| Ответы |
Re: Interruptible sleeps (was Re: CommitFest 2009-07:
Yay, Kevin! Thanks, reviewers!)
|
| Список | pgsql-hackers |
Jeff Davis <pgsql@j-davis.com> writes:
> I glanced at the code, and I see (in OwnLatch()):
> + if (latch->owner_pid != 0)
> + elog(ERROR, "latch already owned");
> + latch->owner_pid = MyProcPid;
> But it looks like there may be a race there.
Yeah, that error check is only intended to catch gross logic errors,
not to guard against race conditions. I don't think we really could
prevent a race there without adding a spinlock, which seems like
overkill.
> ... why throw an ERROR there if it can't happen (or
> indicates an inconsistent state when it does happen)?
Are you suggesting that an Assert would be sufficient?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера