Re: gamma() and lgamma() functions
От | Tom Lane |
---|---|
Тема | Re: gamma() and lgamma() functions |
Дата | |
Msg-id | 1675034.1725474889@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: gamma() and lgamma() functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
I wrote: > AFAICS this patch doesn't inspect signgam, so whether it gets > overwritten by a concurrent thread wouldn't matter. However, > it'd be a good idea to add a comment noting the hazard. Further to that ... I looked at POSIX issue 8 (I had been reading 7) and found this illuminating discussion: Earlier versions of this standard did not require lgamma(), lgammaf(), and lgammal() to be thread-safe because signgam was a global variable. They are now required to be thread-safe to align with the ISO C standard (which, since the introduction of threads in 2011, requires that they avoid data races), with the exception that they need not avoid data races when storing a value in the signgam variable. Since signgam is not specified by the ISO C standard, this exception is not a conflict with that standard. So the other reason to avoid using signgam is that it might not exist at all in some libraries. regards, tom lane
В списке pgsql-hackers по дате отправления: