| От | Bruno Wolff III |
|---|---|
| Тема | Re: Random not so random |
| Дата | |
| Msg-id | 20041004155742.GA8488@wolff.to обсуждение исходный текст |
| Ответ на | Re: Random not so random (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
On Mon, Oct 04, 2004 at 10:14:19 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > It occurs to me that you might be seeing predictability as an indirect > result of something else you are doing that somehow tends to synchronize > the backend start times. Are you connecting from a cron script that > would tend to be launched at the same relative instant within a second? > > It might improve matters to make the code do something like > > srandom((unsigned int) (now.tv_sec ^ now.tv_usec)); Using /dev/urandom, where available, might be another option. However, some people may not want their entropy pool getting 4 bytes used up on every connection start up.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера