Re: pthread portability

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pthread portability
Дата
Msg-id 30943.1459258975@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pthread portability  (Christoph Moench-Tegeder <cmt@burggraben.net>)
Список pgsql-hackers
Christoph Moench-Tegeder <cmt@burggraben.net> writes:
> ## Alvaro Herrera (alvherre@2ndquadrant.com):
>>> The below diff fixes one problem: you can't compare pthread_t values
>>> directly. Only the function pthread_equal(3) is defined. Direct
>>> comparison usually works because most implementations define pthread_t
>>> as an integer type.

>> So is there a platform where this assumption doesn't hold?

> E.g. FreeBSD has "typedef struct pthread *pthread_t;" with a
> non-trivial "struct pthread".

Seems like pointer comparison would be sufficient in that case, so
I'm still not following what real-world problem this change fixes.

I read the POSIX spec's rationale for pthread_equal and found it
utterly unconvincing, BTW.  If pthread_equal tries to dereference
the given pointer and said pointer is stale, what is the reason
to think it even points to still-allocated memory?
        regards, tom lane



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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: [PROPOSAL] Client Log Output Filtering
Следующее
От: David Steele
Дата:
Сообщение: Re: improving GROUP BY estimation