| От | Magne Mæhre |
|---|---|
| Тема | Spinlock backoff algorithm |
| Дата | |
| Msg-id | 473AC13B.1060008@sun.com обсуждение исходный текст |
| Ответы |
Re: Spinlock backoff algorithm
Re: Spinlock backoff algorithm |
| Список | pgsql-hackers |
I was playing with a Nevada server and noticed a rush on the FPU (the Nevada has a single shared FPU for its 32 threads). Looking at the spinlock code, I found : cur_delay += (int) (cur_delay * ((double) random() / (double) MAX_RANDOM_VALUE) + 0.5); I understand the reasoning for the backoff (as of the discussion on 2003-08-05), but is there any particular reason for using floating point operations here ? Maybe a modulo would be just as good (or better since it doesn't involve the FPU) ? Something like: cur_delay += random() % (cur_delay + 1) ; --Magne
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера