[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Across Lua universes (was Re: lua_pushtable)
- From: Mark Hamburg <mhamburg@...>
- Date: Fri, 04 Jun 2004 11:01:11 -0700
on 6/4/04 7:10 AM, Mike Pall at firstname.lastname@example.org wrote:
> I have been hit by this restriction, too because I have the need to pass
> arbitrary objects between different Lua universes (in the same process).
> After some research, I guess I have to pass around proxies or just copies.
> Not very efficient, but I found no better way. It is definitely hopeless
> to make the GC cross-universe-aware to avoid the copying overhead.
If the preferred Lua way to handle multiple processors and other cases where
cooperative multi-threading isn't an option is to use multiple Lua
universes, then there needs to be good support for packaging stuff up and
sending it between universes. I'm not sure what that would look like,
however. The current thread on Lua persistence might be a pointer, but I
think the cross-universe case might be able to exploit things like the fact
that the C function pointers can be used in both places, light userdata
should remain meaningful, etc..