lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Ignacio Burgueño wrote:
On Tue, Mar 16, 2010 at 2:54 PM, Javier Guerra Giraldez
<javier@guerrag.com>wrote:

 i guess that your Lua's math.random() is not stock Lua's.  if it were,
we should get the same numbers given the same seeds.

can other members try this and see if everybody gets exactly the same
random numbers?  this is Kubuntu 9.04 x86_64 with Lua 5.1.4 default
install.


I get the following, with Lua 5.1.4. Windows7 x64 (32 bit lua) and the same
on Windows XP SP3.

Seed: 3063121584 12 2356 6482 744
Seed: 2428144928 12 2356 6482 744
Seed: 3559301251 12 2356 6482 744
Seed: 4287790062 12 2356 6482 744
Seed: 2737803158 12 2356 6482 744
Seed: 2458923424 12 2356 6482 744

I got similar problems a while back in luatex, which uses the coco
patches. For us, the problems seemed related to the Windows handles
threads/fibers: each new thread gets a totally fresh rand()
environment with a default seed value, regardless of earlier srand()
calls in the main program. Could this be something similar?


Best wishes,
Taco