Re: Spinlock backoff algorithm

Поиск
Список
Период
Сортировка
От Trevor Talbot
Тема Re: Spinlock backoff algorithm
Дата
Msg-id 90bce5730711141450i54dff2d8v93bd07597c1843d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Spinlock backoff algorithm  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 11/14/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> The other problem with using modulo is that it makes the result depend
> mostly on the low-order bits of the random() result, rather than mostly
> on the high-order bits; with lower-grade implementations of random(),
> the lower bits are materially less random than the higher.  Now
> admittedly high-grade randomness is probably not too important for this
> specific context, but I dislike putting in poor coding practices that
> someone might see and copy without thinking...

If there's a dependency on a particular quality of random()
implementation, why not just include one?  Mersenne Twister is easy,
while not being cryptographic strength.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html


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

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: Simplifying Text Search
Следующее
От: Tom Lane
Дата:
Сообщение: Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris