[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: what is the role of the `seed` field in the Lua global state?
- From: 云风 <cloudwu@...>
- Date: Thu, 12 Mar 2020 23:14:06 +0800
> 在 2020年3月12日,22:39,Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> 写道:
>
>
>>
>> Is there any way to specify a seed when I create a new lua VM ? It's
>> very useful for reproduction of bugs .
>> If the seed is always random, the order of table iteration would be
>> different every time.
>
There is another reason that I want to set the seed by myself.
Our system use thousands lua VMs in one process. I make a small patch to share the function protos (including strings) among these VMs. So I need these VMs use the same seed, so that the strings’ hash can be used in any of these VM.