random() in multi-threaded pgbench

Поиск
Список
Период
Сортировка
От Takahiro Itagaki
Тема random() in multi-threaded pgbench
Дата
Msg-id 20091210152444.1B6E.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответы Re: random() in multi-threaded pgbench
Список pgsql-hackers
While testing the pgbench setshell command patch with -j option,
I found all threads use the same sequence of random value.

At first, I think we need to call srandom() in each thread,
but the manual says we should use random_r() instead of random()
on multi-threaded programs.
http://www.kernel.org/doc/man-pages/online/pages/man3/random_r.3.html

Should we replace random() to random_r()?
Some configure test might be needed.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center



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

Предыдущее
От: Takahiro Itagaki
Дата:
Сообщение: Re: Largeobject Access Controls (r2460)
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [patch] pg_ctl init extension