[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Deterministic table iteration
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 9 Feb 2013 13:14:47 -0200
> I have 2 machines, running the exact same code (both Lua and C). They both
> > start from a clean state. The order of insertions is identical and the data
> > being inserted is also identical.
>
>
> In this case, I suspect that iterations over everything other than userdata
> and function keys will be deterministic. I don't trust my own knowledge of
> Lua's internals enough to say that with total confidence -- but, a quick
> reading of ltable.c suggests it's true.
Even if you rerun the code in the same machine the execution
will not be deterministic. In fact, this non determinism has been
considered a "good thing", as it can avoid those mythical "collision
attacks" on tables.
-- Roberto