Page 1 of 1

Threads and Existing Code

Posted: Wed Mar 25, 2015 8:22 pm
by Goober
Is there a way to run existing functions inside of a thread, or do you need to supply a separate file? I have a bunch of functions I'd like to use in general, but also want to call inside of a thread.

[Edit]: After some research, I'd like to revise my question: is there a way to copy the current state of the game into another thread? Essentially I just want to copy over _G, since it has all of the information and functions I want to process in the thread, but Thread:push() doesn't support non-flat tables for some reason.

[Edit 2]: I'm trying pickling the information I need, then unpickling it on the other side. I can't seem to use require though in my thread. It always says the module can't be found.