Skip to content

Spawning a thread and call a function from lua #406

Answered by khvzak
ghosty2004 asked this question in Q&A
Discussion options

You must be logged in to vote

Lua (and mlua) is strictly !Sync, you cannot do this.
To achieve true parallelism you can spawn another Lua interpreter to execute function (passed as source code) then serialize results and pass back to main VM.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ghosty2004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants