lua-users home
lua-l archive

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


Erlang does not share state between processes, at least only in a very limited way. So while sending the data is cheap you still have separate copies of data. You could keep the shared state in an ETS table but the would entail a lot of copying when you access it. I have exactly this problem in Luerl, it is very easy to run very many instances but they are not sharing state.

Robert



On 20 March 2014 14:42, 云风 <cloudwu@gmail.com> wrote:
2014-03-20 20:51 GMT+08:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:

> Are you really sharing the Proto object or only the bytecode (and maybe
> some other fields)? If you are sharing the Proto object, how to you
> handle its constants (field 'k')? They include strings, and short strings
> cannot be shared (at least directly), due to internalization.
>
> -- Roberto
>

I wish lua can support share strings and prototypes directly in future
version , so that we can run many lua states on many-core , and
passing the constants between lua states can be very cheap (like
Erlang does).

--
http://blog.codingnow.com