[PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
Вложения
В списке pgsql-bugs по дате отправления:
| От | Martin Pitt |
|---|---|
| Тема | [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] |
| Дата | |
| Msg-id | 20111218224203.GA2950@piware.de обсуждение исходный текст |
| Ответ на | Re: TAS patch for building on armel/armhf thumb (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Ответы |
Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS
patch for building on armel/armhf thumb]
|
| Список | pgsql-bugs |
Hello all, Heikki Linnakangas wrote: > An even better approach would be to have a configure test for > __sync_lock_test_and_set. A quick google search suggests that Intel > C Compiler version >= 11.0 also supports __sync_lock_test_and_set, > for example. Right, http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html explicitly refers to intel CC as well. > It probably makes sense to use it on any platform where it's > defined. Presumably an implementation provided by the compiler is > always going to be at least as good as any magic assembler > incantations we can come up with. I agree. How about a patch like this? It uses builtin atomics if available, and falls back to the custom implementations if not. Note that a simple AC_CHECK_FUNC(__sync_lock_test_and_set) does not work, so I used a slightly more complicated AC_TRY_LINK() which also verifies that __sync_lock_release() is available. The patch is against 9.1.2, but I suppose it also applies to trunk (except perhaps the autogenerated configure part, this needs an autoheader/autoconf run). Thanks for considering, Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера