Metatables across threads
Posted: Sun Jan 31, 2021 2:23 pm
I'm using a thread to perform level generation so I can show progress and keep on rendering things while it's happening.
But the final object being passed to the main thread is a nested table and it seems that the metatables of the sub-tables are not preserved "through" the channel.
I can instead pass the necessary data and construct the objects after the level generation, but it seems to be like this makes using the separate thread (slightly) less useful.
Is this a feature of channels? Is it a feature that is likely to be changed? Or have I just missed something in my code?
Thanks to anyone who can help!
But the final object being passed to the main thread is a nested table and it seems that the metatables of the sub-tables are not preserved "through" the channel.
I can instead pass the necessary data and construct the objects after the level generation, but it seems to be like this makes using the separate thread (slightly) less useful.
Is this a feature of channels? Is it a feature that is likely to be changed? Or have I just missed something in my code?
Thanks to anyone who can help!